A very simple program

// Author: Karl Abrahamson
// Date:   01/12/00
//
// This program reads two numbers from the user and prints their sum.

#include <iostream>
using namespace std;

int main()
{
  int n,m;

  cout << "What numbers shall I sum? ";
  cin >> n >> m;
  cout << "The sum of " << n << " and " << m << " is " << n+m << endl;
  return 0;
}

Notes on the program

Always put your name in the program, right up front. Take credit for your work. Notice that the name is in a comment, beginning with //.

// Author: Karl Abrahamson
// Date:   01/12/00
Always put a comment at the top of the program telling what the program does. When you come back to the program later, you will not remember what it is for, and this comment is very helpful.
//
// This program reads two numbers from the user and prints their sum.
The next lines allow you to use cin, cout and operations for reading and writing. You need it.
#include <iostream>
using namespace std;
The main program is called main (all lower case). By definition, it returns an int, regardless of anything that you have been told in the past. The following line is the heading for the main program.
int main()
The body of the main program must be enclosed in braces.
{
Notice that the variables are declared inside the main program, not outside. Variables that are declared outside are called global variables, and you should not be using them.
  int n,m;
Now we read n and m and print the result. Notice that the input is echoed. Notice the spaces to keep things from being packed together. Notice the endl to get a carriage return to be printed.
  cout << "What numbers shall I sum? ";
  cin >> n >> m;
  cout << "The sum of " << n << " and " << m << " is " << n+m << endl;
The main program returns a status value to the operating system. A status of 0 means that all went well. A nonzero status means that an error occurred. We return 0.
  return 0;
}