Program to show use of goto. This program ends only when the user presses Ctrl-Break. - C++ Statement

C++ examples for Statement:goto

Description

Program to show use of goto. This program ends only when the user presses Ctrl-Break.

Demo Code

#include <iostream>
using namespace std;
int main()/*from  ww w  .  j a va  2s .  c  o  m*/
{
   Again: cout << "This message \n";
   cout << "\t keeps repeating \n";
   cout << "\t\t over and over \n";
   goto Again;   // Repeat continuously.
   return 0;
}

Result


Related Tutorials