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
Describe the difference between = and == symbols in c programming?
What are predefined functions in c?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What is the purpose of & in scanf?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
Can the size of an array be declared at runtime?
What is difference between array and pointer in c?
What is a pointer in c plus plus?
What is indirection? How many levels of pointers can you have?
Write programs for String Reversal & Palindrome check
What 'lex' does?
what is recursion in C
Do array subscripts always start with zero?
Difference between constant pointer and pointer to a constant.
What the advantages of using Unions?