N00B Questions.

I've just started learning C++ about three days ago, and surprisingly, its going quite well so far. I have a few questions I am wondering if anyone could help me with.

1. I'm trying to make it so if someone types help, text that just says HELP HERE pops up.

2. Is it possible to make the application restart after its been finished?. So, instead of it closing, it just loops back to the first piece of code and restarts?.

Here is my code I was hoping I could get some help with. Thanks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>     
using namespace std;    

int main()
{
    cout<<"Input one number to have it multiplied by another of your choice \n";
int var1;
int var2;
int var3;
cin>>var1; 
cin.ignore(); 
    cout<<"x\n";
cin>>var2;
cin.ignore();

var3 = var1*var2;

cout<<"= ";
cout<<var3<<endl;
cout<<"\nPlease hit enter to close this application";

cin.get();
return 0;
}
Welcome. :)

The answers to both one and two are yes. Do you know anything about control structures? If not, I recommend checking out the tutorial here:
http://cplusplus.com/doc/tutorial/control/

After learning about these, you should be able to solve your problem.

Have fun!

-Albatross

Psst... hey... other members... is it too early to let him/her know about this website being a trap, and that we conduct all sorts of unethical computer-based tests on people whom we hold here by force? Or should I wait a bit with that?
Thanks!. I'll start reading over that now.
Topic archived. No new replies allowed.