My first program just exits?

I successfully created a math program!Learned it in my golden 30 minutes :D
So the problem is
when i compile it, it just exits by it self, i do see words, is there anyway for me to look at it? i want it to wait for me to press something (any key) before exiting by it's self! Help me!!! T.T
thanks, it'll help but where should i insert it?

my code is..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//My First C++ Program!

#include <iostream>
using namespace std;

int main ()
{
  int a, b, c, x, y ,z;
  int result;
  int MultipliedResult;
  
  a = 4;
  b = 9;
  c = b - a; 
  x = 85;
  result = c + x;
  z = result + result;
  MultipliedResult = z + z;

  cout << "hello!";
  cout << "i'm programmed by Arisaitou"; 
  cout << " Hoho! ";            
  cout << " I'm a C++ program"; 
  cout << " Okay, A = 7, B = 9, and C = b - a , and X = 90";
  cout << " then the result must be c + x, the answer is ";
  cout << result;
  cout << "  Multiplied by two then.. ";
  cout << z;
  cout << "  Multiplied by two AGAIN then.. ";
  cout << MultipliedResult;
  return 0;
}
1
2
3
4
5
6
7
8
  cout << "  Multiplied by two then.. ";
  cout << z;
  cout << "  Multiplied by two AGAIN then.. ";
  cout << MultipliedResult;

  // Insert code here

  return 0;


:)
thanks, you're quiet but helpful :)
Topic archived. No new replies allowed.