#include<stdio.h>
void main()
{
int a=1;
if("%d=hello", a);
}Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
155
Questions
3/8
Page
Pick an option on a question to see the right answer and solution.
#include<stdio.h>
void main()
{
int a=1;
if("%d=hello", a);
}Select an option to see the answer and solution.
#include<stdio.h>
void main()
{
int a=3;
for(;a;printf("%d ", a--);
}Select an option to see the answer and solution.
#include<stdio.h>
void main()
{
int i=1, j=-1;
if((printf("%d", i)) < (printf("%d", j)))
printf("%d", i);
else
printf("%d", j);
}Select an option to see the answer and solution.
for(i = 0; i<10; i++);
printf("%d", i);Select an option to see the answer and solution.
#include<stdio.h>
void main()
{
int s=0;
while(s++<10)
{
if(s<4 && s<9)
continue;
printf("%dt", s);
}
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include<stdio.h>
int c[10] = {1,2,3,4,5,6,7,8,9,10};
main()
{
int a, b=0;
for(a=0;a<10;++a)
if(c[a]%2 == 1)
b+=c[a];
printf("%d", b);
}Select an option to see the answer and solution.
for(i=10; i++; i<15)
printf("%d ", i);Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include<stdio.h>
void main()
{
int y=10;
if(y++>9 && y++!=10 && y++>11)
printf("%d", y);
else
printf("%d", y);
}Select an option to see the answer and solution.
void main()
{
int sum=1, index = 9;
do{
index = index – 1;
sum *= 2;
}while( index > 9 );
}Select an option to see the answer and solution.
void main()
{
int num = 0;
do{
--num;
printf("%d", num);
}while( ++num >= 0 );
}Select an option to see the answer and solution.
void main()
{
int digit = 0;
for( ; digit <= 9; )
digit++;
digit *= 2;
--digit;
}Select an option to see the answer and solution.
switch(choice)
{
case 'R' : printf("RED");
case 'W' : printf("WHITE");
case 'B' : printf("BLUE");
default : printf("ERROR");break;
}Select an option to see the answer and solution.
for(c=1, sum=0; c <= 10; c++)
{
scanf("%d", &x);
if( x < 0 ) continue;
sum += x;
}
What would be the value of sum for the input 1, -1, 2, -2, 3, -3, 4, -4, 5, -5Select an option to see the answer and solution.
void main()
{
int x=0;
for( ; ; )
{
if( x++ == 4 ) break;
continue;
}
printf("x=%d", x);
}Select an option to see the answer and solution.
void main()
{
int a[5] = {6,8,3,9,0}, i=0;
if(i != 0)
{
break;
printf("%d", a[i]);
}
else
printf("%d", a[i++]);
}Select an option to see the answer and solution.
#include <stdio.h>
void main()
{
int ch;
printf("enter a value between 1 to 2:");
scanf("%d", &ch);
switch (ch, ch + 1)
{
case 1:
printf("1\n");
break;
case 2:
printf("2");
break;
}
}Select an option to see the answer and solution.
#include <stdio.h>
void main()
{
int i = 0;
do
{
printf("Hello");
} while (i != 0);
}Select an option to see the answer and solution.