Read OnLine Cpp Program Example


4 - LOOP CONCEPT
PRAC 3  
//wap to print out of loop
#include<iostream.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for (i=1;i<=10;i++)
{
if (i==5)
{
goto xyz;
}
cout<<"\n"<<i;
}
xyz:
cout<<"Out of loop";
getch();
}
------outpt------
1
2
3
4
out of loop
Previous Next
Download