+ 1

Can you explain please

#include <stdio.h> int r(){ static int num=7; return num--; } int main(){ for (r();r();r()) printf("%d",r()); return 0; }

20th Jan 2021, 5:25 PM
Shivam Godbole
Shivam Godbole - avatar
1 Answer
+ 2
I marked the for loop as follow: for(r1() ; r2() ; r3()) printf("%d", r4()) The loop goes like this: r1() 7->6 r2() 6->5 r4() 5->4 //printed 5 r3() 4->3 r2() 3->2 r4() 2->1 //printed 2 r3() 1->0 r2() 0-> -1 // 0 is false. Loop ends.
20th Jan 2021, 5:37 PM
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż - avatar