print()
scanf()
input()
All of the above
Input data
The program does not require any function.
Output data
The program must have at least one function.
What is the output of this statement
printf("%d", (a++));
The value of (a + 1)
Error message
Garbage
The current value of a
do-while
if-else
for
while
Character
Integer
Float
enum
What would be value of j after the following is executed?
k=17; j=6; if (k < 10) j=8; j=j+1; j=j+2;
8
9
7
10
What will be output after compilation and execution of the following code?
int main() { int array[3]={5}; int i; for (i=0;i<=2;i++) printf("%d ",array[i]); return 0; }
5 garbage garbage
5 0 0
0 0 0
5 5 5
What is the value of r after this code is executed?
r=2; k=8; if (r>3 || k>6 && r<5 ||k>10) r=9; else r=6
2
6
What will be the output of the following program?
main() { int x = 5; while ( x = = 1) x = x -1; printf ( “ %d\n”, x); }
5
4
0
syntax error
What will be output if you will compile and execute the following C code?
int main(){ int check=2; switch(check){ case 1: printf("D.W.Steyn"); case 2: printf(" M.G.Johnson"); case 3: printf(" Mohammad Asif"); default: printf(" M.Muralidaran"); } return 0; }
M.G.Johnson
M.Muralidaran
M.G.Johnson Mohammad Asif M.Muralidaran
Compilation error
How many times "IndiaBIX" is get printed?
int main() { int x; for(x=-1; x<=10; x++) { if(x < 5) continue; else break; printf("IndiaBIX"); } return 0; }
Infinite times
11 times
0 times
10 times
What will be the output of the following code segment?
int a = 100, b = 74; if (a++ > 100 && b++ > 200) printf("High values with a = %d b = %d\n", a, b); if (a++ < 100 || b++ < 200) printf("Low values with a = %d b = %d\n", a, b);
High values with a = 101 b = 74
Low values with a = 102 b = 75
High values with a = 102 b = 75
Low values with a = 101 b = 74
How many times below for loop will be executed?
int main() { int i=0; for( ; ; ) printf("%d",i); return 0; }
1 times
How many times the printf statement within the while loop will be executed?
int x=1; while(x=0) printf("hello");
1
infinite
What will be the output of the following code?
main() { int x = 0, y = 0; if(x > 0) if(y > 0) printf("True"); else printf("False"); }
Blank screen
True
False
Error because of dangling else problem
What will be output if you compile and execute the following ‘C’ code?
void main() { float a=5.2; if(a==5.2) printf("Equal"); else if(a<5.2) printf("Less than"); else printf("Greater than"); }
float a=5.2; if(a==5.2) printf("Equal"); else if(a<5.2) printf("Less than"); else printf("Greater than"); }
Equal
Less than
Greater than
int
char
long
all of the mentioned
default case is optional inside switch.
break; causes the control to exit the switch immediately and avoid fall down to other CASE statements.
You can not use duplicate CASE Constants inside a Switch construct.
All the above.