C++ examples for Data Type:const
Compare int value with constant value
#include <iostream> using namespace std; int main()//from ww w . j av a 2 s .c om { const double LIMIT = 3000.0; int id; double miles; cout << "Please type in car number and mileage: "; cin >> id >> miles; if (miles > LIMIT) cout << " Car " << id << " is over the limit.\n"; cout << "End of program output.\n"; return 0; }