|
-
November 20th, 2011, 06:00 PM
#1
Help a newbi
Ok so i'm trying to write something very simple, I'm a complete newbi.
#include <iostream>
using namespace std;
int age;
char answer;
int main()
{
cout << "Hello, And welcome to my Quiz, This is just a basic Program\n\n";
system("PAUSE");
system("CLS");
cout << "Please enter your Age\n";
cin >> age;
cout << "So you are " << age << " Years old?, Y/N \n";
cin >> answer;
if(answer == "Y" || answer == "y")
{
cout << "Ok ";
}
system("PAUSE");
}
If you press N i wan't it to go Back to where you enter your age, How do i send it back to that line?, Or do i just ask the question again?
Last edited by UpcomingChris; November 20th, 2011 at 06:09 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|