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 / bharath kumar
Hello,
The answer is b.
a=0+1=1
a=1+1=2
a=2+1=3
a=3+1=4
a=4+1=5
While a variable is storing the 5 result a is nither less
then are equal to 5 hence the application will come out of
the loop.So while loop had run 5 times.
| Is This Answer Correct ? | 28 Yes | 4 No |
Post New Answer View All Answers
What is header file definition?
What are loops c?
What is queue in c?
What is the difference between %d and %i?
What is the use of ?
What does sizeof return c?
How do you use a 'Local Block'?
write a program to generate address labels using structures?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
What is getch c?
What are the main characteristics of c language describe the structure of ac program?
Explain how can you be sure that a program follows the ansi c standard?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
Differentiate between #include<...> and #include '...'
How will you declare an array of three function pointers where each function receives two ints and returns a float?