1.
Point out the error, if any in the for loop
#include
int main()
{
int i=1;
for(;;) {
printf("%d\n", i++);
if(i>10)
break; }
return 0;
}
A. 
There should be a condition in the for loop
B. 
The two semicolons should be dropped
C. 
The for loop should be replaced with while loop
D. 
2.
Pick the right alternative
main()
{
int c=- -2;
while(--c)
printf("c=%d",c);
}
A. 
B. 
C. 
D. 
3.
What will be the output?
main()
{
char s[ ]="m";
int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
}
A. 
B. 
C. 
D. 
4.
What main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
}
A. 
B. 
C. 
D. 
5.
Void main()
{
static int i;
while(i2)?i++:i--;
printf(“%d”, i);
}
A. 
B. 
C. 
D. 
6.
What is the output of this program?
void main()
{
int i=122;
while(i!=97)
i--;
while(i>65)
i--;
printf(“%c”,i);
}
A. 
B. 
C. 
D. 
7.
What is the output of this program?
void main()
{
int i=99;
while(i
A. 
B. 
C. 
D. 
8.
#include
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++);
printf("%lf", k);
}
A. 
B. 
C. 
D. 
9.
What is the output of this program?
void main()
{
int x=1;
x=!x;
while(x!=!x)
{
printf(“%d”,i);
}
}
A. 
B. 
C. 
D. 
10.
What is the output of this program?
void main()
{
int k;
for(k=10; k%2! =0 && k%3!=0;k--)
if(k==1)
break;
printf(“%d”,k);
}
A. 
B. 
C. 
D. 
11.
What is the output of this program?
void main()
{
long int i=3;
while(++i
A. 
B. 
C. 
D. 
12.
What is the output of this program?
void main()
{
int i, j;
for(i=0,j=20; i!=j; i++,j--)
{
printf(“%c”,i+48);
}
}
A. 
B. 
C. 
D. 
13.
What is the output of this program?
void main()
{
int i=0, j=1;
while(i==!j)
{
printf(“%d %d”,!i,!j);
i++; j++;
}
}
A. 
B. 
C. 
D. 
14.
What is the output of this program?
void main()
{
int k;
for(k=32768; k
A. 
B. 
C. 
D. 
15.
The following code stands for what?
void main()
{
int m=60,n=25;
if(m!=n)
{
while(m>n)
m-=n;
interchange(m,n); // assume the function interchange content of m & n
}
printf(“%d”,m);
}
A. 
B. 
C. 
D. 
16.
Void main()
{
int a[5] = {1, 2, 3, 4, 5};
int i;
for (i = 0; i < 5; i++)
if ((char)a[i] == '5')
printf("%d\n", a[i]);
else
printf("FAIL\n");
}
A. 
The compiler will flag an error
B. 
C. 
Program will compile and print the ASCII value of 5
D. 
Program prints FAIL for 5 times
17.
What is the output of this program?
#include
#include
void main()
{
printf(“%d”, (2*(1+rand()%4));
}
A. 
B. 
C. 
D. 
18.
What is the output of this program?
void main()
{
int i=0,j=1,k;
while(i
A. 
B. 
C. 
D. 
19.
Fill in the blank:
#include
#include
void main()
{
int i,n;
scanf(“%d”,&n);
for(i=2;isqrt(n))
printf(“%d is ________”,n);
}
A. 
B. 
C. 
D. 
20.
What is the output of this program?
void main()
{
int i;
for(i=10;--i%3==0;i--)
printf(“%d”,i);
}