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


Please Help Members By Posting Answers For Below Questions

Explain how do you list files in a directory?

619


How will you write a code for accessing the length of an array without assigning it to another variable?

617


Why is c called "mother" language?

858


What does the error 'Null Pointer Assignment' mean and what causes this error?

743


Is it possible to have a function as a parameter in another function?

600






What is the difference between scanf and fscanf?

665


Why is event driven programming or procedural programming, better within specific scenario?

1955


Why C language is a procedural language?

623


What is the argument of a function in c?

576


How to create struct variables?

595


What are external variables in c?

548


Why do we use & in c?

593


Is main an identifier in c?

605


What is indirection in c?

629


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

1907