how does the for loop work actually..suppose for the
following program how it ll work plz explain to me
for(i=5;i>=0;i--)
prinf(i--);
Answer Posted / manju
The output for the given for loop is
5 3 1.
why because...
first the value of (i=5)>=0,so 5 is printed.After that i
value is decremented because of i-- in the printf() and
again i value is decremented as specified in for loop.
Now the value of i=3.
Again the loop will be continued untill the value of i
becomes 0.
| Is This Answer Correct ? | 15 Yes | 1 No |
Post New Answer View All Answers
How many loops are there in c?
What are type modifiers in c?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What is the difference between mpi and openmp?
Write a program which returns the first non repetitive character in the string?
Is c high or low level?
What is a list in c?
Should a function contain a return statement if it does not return a value?
What is include directive in c?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
Explain what is a static function?
Differentiate between a structure and a union.
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
Why is c so popular?
given post order,in order construct the corresponding binary tree