What is the meaning inside the for loop? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
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 Antworten
+ 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