simple code -Need Help Please

Jul 20, 2013 at 1:13am
Hey this is a simple code and all i have is one error, but I am not sure exactly how to fix it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  // Listing 2.2 using std::cout
 #include <iostream>
 int main
 {
     std::cout << "Hello There.\n";
     std::cout << "Here is 5: " << 5 << "\n";
     std::cout << "The manipulator std::end1 ";
     std::cout << "writes a new line to the screen. ";
     std::cout << "Here is a very big number:\t" << 70000;
     std::cout << "Here is the sum of 8 and 5:\t";
     std::cout << (8+5) << 
     std::cout << "Here's a fraction:\t\t";
     std::cout << (float) 5/8 << std::end1;
     std::cout << "And avery big number:\t";
     std::cout << (double) 7000 * 7000 << 
     std::cout << "Don't forget to replace jesse ";
     std::cout << "with your name...\n";
     std::cout << "jesse is a C++ programmer!\n";
     return 0;
 } 
Jul 20, 2013 at 2:12am
only issue I see if and of line 11 there's no semicolon. In the future it's helpful if you post any error messages your compiler gives you, or whatever other indications you have of a problem.
Last edited on Jul 20, 2013 at 2:13am
Jul 20, 2013 at 2:31am
yes definitely, change line 11 to:
std::cout<<(8+5)<<std::endl;

the same with line 15.
Topic archived. No new replies allowed.