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
Explain how do you list files in a directory?
How will you write a code for accessing the length of an array without assigning it to another variable?
Why is c called "mother" language?
What does the error 'Null Pointer Assignment' mean and what causes this error?
Is it possible to have a function as a parameter in another function?
What is the difference between scanf and fscanf?
Why is event driven programming or procedural programming, better within specific scenario?
Why C language is a procedural language?
What is the argument of a function in c?
How to create struct variables?
What are external variables in c?
Why do we use & in c?
Is main an identifier in c?
What is indirection in c?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b