Thursday, 5 February 2015

Goto Statement in C++

Structure of the Problem Requirements 

Goto statement provide a jump without any condition to the goto specific label in a function. Through goto stalemate we also make our program infinite . But goto statement leave badly impact on the flow of program and programmer and developers recommend to avoid it.

Source Code

using namespace std;
int main()
string name ;
int ID ;
string job;
char choice;
cout<<" Enter Your Name : ";
cout<<" Enter Your ID : ";
cout<<" Enter Your Job Title : ";
cout<<" Do You want to Stay with us? Y/N : ";
cin>> choice;
if (choice == 'Y')
goto welcome;
if (choice == 'N')
return 0;

Output of the Program

Goto Statement in C++

Share it Please

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.


Post a Comment