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 / devi dayal jangra
syntax error.... in prinf...but it should be corrected then
the result will be
5
3
1
Note ...
in first run I=5; printf(i--) print I which is 5 and store 4
in i.
in second run i-- means 4-1=3 then printf(i--) print 3 and
store 2 in i.
in third run... i-- measn 2-1=1 then printf(i--) print 1 and
store 0 in i.
then decreament statement i-- store 1=-1 and when compare
-1>=0 become false and goto next statement after that loop.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
a program that can input number of records and can view it again the record
Is anything faster than c?
What language is windows 1.0 written?
What is the mean of function?
Explain how can I manipulate strings of multibyte characters?
What are variables and it what way is it different from constants?
How can I find out the size of a file, prior to reading it in?
What is the difference between Printf(..) and sprint(...) ?
How will you divide two numbers in a MACRO?
What are structural members?
Define and explain about ! Operator?
What is the general form of a C program?
Explain what is the difference between a string and an array?
What is #define used for in c?
What is time null in c?