Good Programming Practice in Dev C++
Thursday, 9 August 2012
Lecture: 136
Lecture 136
//
Loop
GoTo
#include <iostream>
#include <conio.h>
using namespace std;
main ()
{
int i;
i=0;
cout<<"Even number: ";
Loop1: //Label
if(i==10)
goto Loop2;
cout<<i<<" ";
i+=2;
goto Loop1;
Loop2:
getch();
return 0;
}
Output:
Newer Post
Older Post
Home