C while loops ♾️

Published: 06 October 2021
on channel: Bro Code
69,035
1.5k

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;
}


Watch video C while loops ♾️ online without registration, duration hours minute second in high quality. This video was added by user Bro Code 06 October 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 69,03 once and liked it 1.5 thousand people.