Back to Browse

C while loops ♾️

99.3K views
Oct 6, 2021
3:50

C while loops tutorial example explained #C #while #loop int main() { // while loop = repeats a section of code possibly unlimited times. // WHILE some condition remains true // a while loop might not execute at all char name[25]; printf("\nWhat's your name?: "); fgets(name, 25, stdin); name[strlen(name) - 1] = '\0'; while(strlen(name) == 0) { printf("\nYou did not enter your name"); printf("\nWhat's your name?: "); fgets(name, 25, stdin); name[strlen(name) - 1] = '\0'; } printf("Hello %s", name); return 0; }

Download

1 formats

Video Formats

360pmp45.2 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

C while loops ♾️ | NatokHD