filmov
tv
continue Inside while & do while in C - C Programming Tutorial 59

Показать описание
Notes for You:: continue Inside while & do while in C.
- Computer skips statement(s) under the continue statement, and transfers the control to the condition part of the loop in the context of while and do while loops whereas in the context of for loop, control is transferred to increment / decrement part.
Example Code:
- Displaying 1,2,3,4,5 using while loop.
int i =1;
while(i<6)
{
printf("%d\n", i);
i++;
}
Example Code:
- continue inside while loop in C.
- Displaying 1,2,4,5 using while loop.
int i =0;
while(i<5)
{
i++;
if(i==3)
{
continue;
}
printf("%d\n", i);
}
Example Code:
- continue inside do while loop in C.
- Displaying 1,2,4,5 using do while loop
int i =0;
do
{
i++;
if(i==3)
{
continue;
}
printf("%d\n", i);
}while(i<5);
Note:
- replace < with less-than symbol.
=========================================
Follow the link for next video:
C Programming Tutorial 60 - goto Statement in C Programming Language
Follow the link for previous video:
C Programming Tutorial 58 - continue Statement in C Programming Language
=========================================
C Programming Tutorials Playlist:
=========================================
Watch My Other Useful Tutorials:-
Computer Programming Fundamentals Playlist:-
C Practical LAB Exercises Playlist:-
C++ Tutorials Playlist:
=========================================
► Subscribe to our YouTube channel:
► Visit our Website:
=========================================
Hash Tags:-
#ChidresTechTutorials #CProgramming #CProgrammingTutorial
- Computer skips statement(s) under the continue statement, and transfers the control to the condition part of the loop in the context of while and do while loops whereas in the context of for loop, control is transferred to increment / decrement part.
Example Code:
- Displaying 1,2,3,4,5 using while loop.
int i =1;
while(i<6)
{
printf("%d\n", i);
i++;
}
Example Code:
- continue inside while loop in C.
- Displaying 1,2,4,5 using while loop.
int i =0;
while(i<5)
{
i++;
if(i==3)
{
continue;
}
printf("%d\n", i);
}
Example Code:
- continue inside do while loop in C.
- Displaying 1,2,4,5 using do while loop
int i =0;
do
{
i++;
if(i==3)
{
continue;
}
printf("%d\n", i);
}while(i<5);
Note:
- replace < with less-than symbol.
=========================================
Follow the link for next video:
C Programming Tutorial 60 - goto Statement in C Programming Language
Follow the link for previous video:
C Programming Tutorial 58 - continue Statement in C Programming Language
=========================================
C Programming Tutorials Playlist:
=========================================
Watch My Other Useful Tutorials:-
Computer Programming Fundamentals Playlist:-
C Practical LAB Exercises Playlist:-
C++ Tutorials Playlist:
=========================================
► Subscribe to our YouTube channel:
► Visit our Website:
=========================================
Hash Tags:-
#ChidresTechTutorials #CProgramming #CProgrammingTutorial
Комментарии