C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 5th, 2013, 09:09 AM
as16ai as16ai is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2013
Posts: 1 as16ai User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 22 sec
Reputation Power: 0
Smile General - How to goes back to the main menu after the user type y?

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
system("COLOR F2");
int yeah,ans;
cout<<" Welcome To MACARONIAN AIR "<<endl;
cout<<" 'Not Just Low Cost' "<<endl<<endl;
char str[20];
int length = 0;
cout<<" Please enter your name: ";
cin.getline(str, 20);
system("cls");
cout<<" Welcome To MACARONIAN AIR "<<endl;
cout<<" 'Not Just Low Cost' "<<endl<<endl;
cout<<"Welcome "<<str<<endl<<endl;
cout<<"Please select the options provided:"<<endl<<endl;
cout<<"1 - Flight Detail"<<endl;
cout<<"2 - Purchase Ticket"<<endl;
cout<<"3 - Print Ticket"<<endl;
cout<<"4 - About Us"<<endl;
cout<<"5 - Exit"<<endl<<endl;
cout<<"Your Selection:";
cin>>yeah;
cout<<endl;
if(yeah!= 1, yeah !=2, yeah !=3, yeah !=4, yeah !=5)
{
cout<<"Sorry You Can Only Select Options 1 - 5 "<<endl<<endl;
cout<<"Would You Like To Return to Main Menu? (y/n):";
cin>>ans;
}



system ("Pause");
return EXIT_SUCCESS;
}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > General - How to goes back to the main menu after the user type y?


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap