Menu

C++ Code Error Message? Help Please

2009-01-29
2012-09-26
  • CrescentScapes

    CrescentScapes - 2009-01-29

    Hello,

    I am entering this code..

    include <iostream.h>

    int main()
    {
    int x = 5;
    int y = 7;
    cout "\n";
    cout << x + y << " " << x * y;
    cout "\n";
    system("pause");
    return 0;
    }

    But no matter what I do I keep on getting this error, "expected `;' before string constant". Any idea what's wrong/what needs to be done? Any help at all would be greatly appreciated. Thank you in advance!

     
    • Wayne Keen

      Wayne Keen - 2009-01-29

      There is more than one error with your code. Look at the errors from the top down. See what is different in this code:

      include <iostream>

      include<cstdlib>

      using namespace std;
      int main()
      {
      int x = 5;
      int y = 7;
      cout << "\n";
      cout << x + y << " " << x * y;
      cout << "\n";
      system("pause");
      return 0;
      }

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.