CPP - Variables
From Global Programming Syntax
Most of the time when making a program, numbers and integers will be needed to make calculations. Below is a simple script to show how to add to a number that has been typed in by the user:
#include <iostream>
using namespace std;
int main()
{
int number; //defines the variable
cout << "Please enter a number: "; // output the text
cin >> number; //input a number
number+=32; //this adds 32 to the number
cout << "\nYour number+32 = " << number << "\n" << endl; //output the text
system("PAUSE");
return 0;
}
As you can see with the above example, the first indented line with int defines the number then the input/output begins. Also as shown in this script, the number integer has 32 added to it. In the way of integers, the above script is a very basic one...
