a=0;
while(a<5)
printf("%d\n",a++);
how many times does the loop occurs?
a.infinite
b.5
c.4
d.6

Answer Posted / deepu_ashu

as the value of "a" increases after printing the value.
so it will print the value
0
1
2
3
4
but after printing the value 4 ,it becomes 5 for the next iteration.
so the condition becomes false.
the loop will not execute any more.

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are # pragma staments?

1621


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

1589


What is the use of typedef in structure in c?

536


Can we declare variables anywhere in c?

571


Is malloc memset faster than calloc?

605






Can you please compare array with pointer?

611


What is switch in c?

640


Suggesting that there can be 62 seconds in a minute?

592


What will the preprocessor do for a program?

583


Why isn't it being handled properly?

641


Explain the use of bit fieild.

702


What do header files do?

598


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

658


Why do we use stdio h and conio h?

628


What are structures and unions? State differencves between them.

605