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 / shikhar
The answer given by preshit is absolutely correct...Lets
see how ,we have >>>
for(i=5;i>=0;i--)
Now we can write this all as :
//start of program
STEP 1 : for(i=5;i>=0;)
{
STEP 2 : prinf(i--);
STEP 3 : i--;
}
//end of program
TT : now the loop will start with i=5
when control reaches printf it firstly executes its
internal statement i.e i-- and then prints i-1(i.e 4) and
it Reduces i by 1.i becomes 3
NOW once again STEP 1 :go to TT
OUTPUT :
4
2
0
Is This Answer Correct ? | 2 Yes | 14 No |
Post New Answer View All Answers
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
What is a wrapper function in c?
What happens if you free a pointer twice?
code for find determinent of amatrix
Is that possible to store 32768 in an int data type variable?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is the use of header?
What is double pointer in c?
What is difference between union All statement and Union?
write a c program to find the sum of five entered numbers using an array named number
Subtract Two Number Without Using Subtraction Operator
What are derived data types in c?
What is const keyword in c?
What is the difference between c and python?
What header files do I need in order to define the standard library functions I use?