"Sum not declared in this scope"

+2 Lauren Wilson · January 17, 2015
Is there something I am missing?

#include <iostream>

using namespace std;

int main()
{
    int a = 4
    int b = 21
    int sum = a + b;

    cout << sum;

    return 0;

}


Post a Reply

Replies

Oldest  Newest  Rating
0 Milan Obrenovic · January 17, 2015
#include <iostream>
using namespace std;

int main()
{
   int a = 4;
   int b = 21;
   int sum = a + b;

   cout << sum;

   return 0;
}
0 Mark Tilford · January 20, 2015
Semicolons
0 ragmar thomas · January 20, 2015
there is something that is called a compiler you should try it some time, try to understand what the line where the error is displayed is meant to say.
  • 1

C++

107,107 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator