Answers for "continue statement in c++ program"

C++
5

continue c++

Continue statement is used inside loops. Whenever a continue statement is
encountered inside a loop, control directly jumps to the beginning of the loop
for next iteration, skipping the execution of statements inside loop’s 
body for the current iteration.
Posted by: Guest on April-30-2021
0

continue statement in c++ program

/*Q: Design a program to print the employee IDs from 1 to 15 and skip the
IDs 7 and 10 because they have resigned.*/
#include<iostream>
using namespace std;
int main()
{
	int meet=0;
	for(int i=1;i<=15;i++)
	{
		if(i==7||i==10)
			continue;
	cout<<"Employe ID="<<i<<endl;			
	}
}
Posted by: Guest on March-17-2022

Browse Popular Code Answers by Language