What will be the output of following program?
int main() { for(int c=1;c<5;++c); printf(“%d”,c); }
1
5
6
12345
stdio.h
conio.h
stdlib.h
None of these
Binary operator
Unary operator
Ternary operator
All of the above
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
What will be the output of the following code?
int main(){int x,y,z;x='1'-'0'; /* line-1 */y='a'-'b'; /* line-2 */z=x+y;printf("%d",z);}
0
Error because of incorrect line-1 only.
Error because of incorrect line-1 and line-2.
Error because of incorrect line-2 only.
<
=
>=
<=
float
double
long double
far double
start()
printf()
main()
getch()
results in a syntax error
output Infomax7
outputs garbage
outputs infomax and terminates abruptly
Keywords can be used as variable names
Variable names can contain digits
Variable names do not contain blank spaces
Capital letters can be used in variable names.
2 bytes
4 bytes
8 bytes
1 byte
"r"
"w"
"rw"
"read"
across
over
under
from
Addition, Division, Modulus
Addition, Modulus, Division
Multiplication, Substration, Modulus
Modulus, Multiplication, Substration
try
catch
finally
What will be the output of the following code segment?
int x = 24, y = 39, z = 45;z = x + y;y = z - y;x = z - y;printf("\n%d %d %d", x, y, z);
24 39 63
39 24 63
24 39 45
39 24 45
Find the output of following code :
int main() { int i=-2; printf (“-i=%d”,-i); return b; }
–i=2
i=-2
–i=-2
–i=+2
//
/
#
/*
What is the output of the following code?
int a = 5;printf("%d", a == 5);
Undefined
The basic data type of C
Qualifier
Short is the qualifier and int is the basic data type
All of the mentioned
Assignment Relational Arithmetic
Arithmetic Relational Assignment
Relational Arithmetic Assignment
Assignment Arithmetic Relational
What will be the output of the following pseudo code ?
Integer aSet a =4do print a + 2 a = a-1while (a not equals 0)end while
6 6 6 6
6 5 4 3
6 7 8 9
6 8 10 12
2
3
4
do-while
if-else
for
while
Call by reference
Call by value
Call by reference by passing base address to a function
Both A and C
Constants
Keywords
Operators
Tokens
8
To exit the function and return control to the calling function
To pause the function temporarily
To call the function again
To exit the program
break stops the loop, continue skips the rest of the iteration
Both stop the loop
break skips to the next iteration, continue exits the loop
Both skip to the next iteration
A
B
ADA
C++
int a = 10, b = 20;printf("%d", a + b);
30
1020
10+20
Compiler error
immutable
mutable
const
volatile
Depends on the system
To determine which operator evaluated first from left to right.
To determine the level of an operator in a program.
To determine how an expression involving more than one operator is evaluated.
To check the expression is valid or not.
exit
break
continue
return
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
getchar()
gets()
scanf()
cin.get()
ctype.h
math.h
for loop
while loop
do-while loop
none of the above
What will be output if you will compile and execute the following c code?
int main(){ int a=5; float b; printf("%d",sizeof(++a+b)); printf(" %d",a); return 0;}
2 6
4 6
2 5
4 5
2.5
2.000000
2.500000
Return
GOTO
Switch
arr[2]
arr(2)
arr[3]
arr[1]
None of the above
&&
| |
!
_infomax
3infomax
infomax_ica
infomax123
main function arguments
main arguments
Command-Line arguments
Parameterized arguments
fclose()
closefile()
fileclose()
endfile()