Read OnLine C- Program Example

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