Sum of Two Numbers
Here we show how to perform simple input, and some computation.
#include <iostream> /* * This program reads two numbers from the console and prints the total. */ int main() { // The two input values. int x,y; // Request and read input. std::cout << "Enter an integer: "; std::cin >> x; std::cout << "Enter another integer: "; std::cin >> y; // Print the total, with proper labels. std::cout << "The sum of " << x << " and " << y << " is " << x + y << "." << std::endl; }

New stuff here: