Programming Lecture 6
Programming Lecture 6
Programming
Lecture 6
VARIABLES EXAMPLES
Dr. Badria Nabil
Assignment 3
2
int var1 = 3;
var1++; // var1 now equals 4
Var1--; // var1 now equals 2
The ++/-- operators can be used in two ways:
Output centimeters
Named Constant
const double CENTIMETERS_PER_INCH = 2.54;
const int INCHES_PER_FOOT = 12;
The numbers you entered are 15 for feet and 7 for inches.
The total number of inches = 187
The number of centimeters = 474.98