error before numeric constant location

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dshfbhsdgz1
    New Member
    • Jul 2013
    • 2

    error before numeric constant location

    this is my code in c++ and its very simpile but wont compile

    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
    
        cout << "Here is some text \n";
        cout << "Here is a number: ";
        cout <<  10 ;
        cout <<  endl;
        
        cout << "How much is 15 + 17 the answer is:";
        cout 15 + 17;
        
    
        cin.get();
        return 0 ;
    }
    Last edited by Banfa; Jul 9 '13, 09:53 AM. Reason: Added code tags round code
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Line 14 should be

    Code:
        cout << (15 + 17);

    Comment

    Working...