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 modulus operator. What are the restrictions of a modulus operator?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What does stand for?
Explain what is the difference between the expression '++a' and 'a++'?
What are derived data types in c?
What are the primitive data types in c?
How to write a code for reverse of string without using string functions?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
What are header files in c programming?
Difference between goto, long jmp() and setjmp()?
What header files do I need in order to define the standard library functions I use?
What is pointer & why it is used?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
Explain what happens if you free a pointer twice?