how do you put 2 cout in the same program?

hi i just made my hello world program and i decided to play around with it. but i could not put 2 cout together here is what i did:

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World! my name is Mr.Program!!! ";
system ("pause");
cout << "DONT PRESS MY KEYS! it hurts... ";
return 0;

}
Try repeating the system("pause") after the second cout function.
Oh, and this is a modified version of your code:
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
33
34
35
36
37
#include <iostream>
using namespace std;

int main()
{
bool a = true;
int Kills = 0;
cout << "Hello World! My name is Mr. Jones! \n";
system("pause");
do{
cout << "DON'T PRESS MY KEYS! It hurts...\n";
system("pause");
cout << "Ouch!\n";
system("pause");
cout << "Auugh!\n";
system("pause");
cout << "Unngh...please stop...you there...system(\"pause\"), shut up...\n";
system("pause");
cout << "Oghh...*collapse*\n";
system("pause");
  Kills++;
system("cls");
if(Kills == 1)
  cout << "You there! Stop! PPD! Program Police Department! You have killed a person!\n";
else
  cout << "You there! Stop! PPD! Program Police Department! You have killed " << Kills << " people!\n";
system("pause");
if(Kills == 3)
  {
  cout << "Hah! I am immune to key-pressing!\n";
  a = false;
  }
}while (a);
  cout << "You have been captured and hanged. HAHAHAHA!\nPress ENTER to continue...";
  cin.get();
  return 0;
}
Last edited on
Topic archived. No new replies allowed.