What is the right choice, if the following loop is implemented?
void main(){ int num = 0; do{ --num; printf("%d", num); }while( ++num >= 0 );}

What is the right choice, if the following loop is implemented?

void main(){ int num = 0; do{ --num; printf("%d", num); }while( ++num >= 0 );}
Correct Answer The loop will run infinitely many times.

As the value of num is decremented(--num) and again incremented(++num) and hence no change in num and it remains 0 only causing infinite loop.

Related Questions

Comment on the following 2 C programs.
#include  //Program 1int main(){ int a; int b; int c;}#include  //Program 2int main(){ int a; { int b; } { int c; }}