Loop Questions and Answers
Practice ModeShowing 10 of 98 questions
Q51
Find the output
void main ( )
{
int i;
switch (i)
{
case 1; printf ('%d", i++);
case 2: printf ('%d", i++);
case 3: printf('5d", i++);
default ; printf ('bye");
}
}
}
Answer: Option D
Q52
Find the output
void main ( )
{
int x=3;
while (x--){
int x=10;
x--;
printc('5d", x);
}
}
Answer: Option B
Q53
Find the bug in the followig program
1. void main ( ) {
2. while (1) {
3. if (printf('5d', printf("%d', 5)))
4. printf("%d", 3);
5. brak;
6. }
7. }
Answer: Option D
Q54
Find the output
void main ( )
{
unsigned int i;
for (i=5; i>-1; i--)
printf("cite");
}
Answer: Option C
Q55
Find the output
#define MAX 10
void main ( )
{
int i;
for (i=0; i<MAX; i++)
{
static int count;
count+=count;
}
printf('5d", count);
}
Answer: Option D
Q56
Find the output
void main ( )
{
int x=2
while (++ (x--)==2)
printf("MCA");
printf("MBA");
}
Answer: Option D
Q57
Find the output
void main ( )
{
int i;
for (i=1; i<=3; i++)
{
print: printf("C");
printf("%d", i);
}
}
Answer: Option C
Q58
Find the output
void main ( )
{
unsigned char c='0';
while (++c<=255)
printf ("%d", c);
}
Answer: Option C
Q59
Find the output
void main ( )
char c1;
int i=0;
c1='a';
while (c>=='a' && c1<='z')
{
c1++;
i++;
}
printf ('%d", i);
}
Answer: Option B
Q60
Find the output
enum (false, true);
void main ( )
{
int i=1;
do
{
printf ("%d", i);
i++;
if (i<5)
continue;
}
while (false);
}
Answer: Option B