0

What is the meaning inside the for loop?

#include <stdio.h> int main() { int n,i=1; scanf("%d\n",&n); for(;;) { printf ("%d\n",i); i++; if(i>n) break; } printf ("\nDone"); return 0; }

7th Apr 2021, 10:53 AM
🇮🇳Akash Æ
🇮🇳Akash Æ - avatar
3 Réponses
+ 5
Actually for(;;) is infinity loop. Here print i value n time, each time i value increase by 1. When the i value is greater than n the loop will break. Set language name as tag.
7th Apr 2021, 10:57 AM
Vadivelan
0
Thanks brother. Vadivelan
7th Apr 2021, 11:02 AM
🇮🇳Akash Æ
🇮🇳Akash Æ - avatar
0
Infinite loop .......
16th Apr 2021, 6:07 AM
Amrit
Amrit - avatar