goto loop example : goto « Operators statements « C++ Tutorial






#include <iostream.h>
int main ()
{
  int n=10;
  loop:
  
  cout << n << ", ";
  
  n--;
  
  if (n>0) 
     goto loop;
  
  cout << "Done!";
  return 0;
}
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, Done!"








3.20.goto
3.20.1.Using goto
3.20.2.goto loop example