C Language MCQ’S | Loops 4

Question: 16

How may times Hello is printed?
int main()
{
int a = 0;
while(++a++);
{
printf(“Hello”);
}

return 0;
}


A. 1 time
B. 0 time
C. Infinite times
D. Error: Lvalue Required

 

Question: 17

How many times Hello is printed?

int main()
{
int a = 0;
while(++a)
{
printf(“Hello”);
}

return 0;
}


A. 1 time
B. Infinite Times(Untill Stack is overflow)
C. 2 times
D. Error

 

Question: 18

How many times Hello is printed?

int main()
{
int a = 0;
while(a)
printf(“Hello”);

return 0;
}

A. 1 time
B. Compilation Error
C. 0 time
D. Infinite Times(Untill Stack is Overflow)

 

Question: 19

How many times Hello is printed?

int main()
{
int a = 0;
while(a++)
printf(“Hello”);

return 0;
}


A. 1 time
B. 0 time
C. Infinite times(Untill Stack is overflow)
D. 2 times

 

Question: 20

How many times Hello is printed?

int main()
{
int a = 0;
while(a++ < 5)
printf(“Hello”);
return 0;
}


A. 4 times
B. 5 times
C. 0 time
D. Infinite times

 

Visitor Counter

0060842