123456789101112131415161718192021222324252627282930
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int val1; cout << "enter value1" << endl; cin >> val1; int val2; cout << "enter value2" <<endl; cin >> val2; if (val1 = val2) { cout << "value1 equals value2" << endl; } else if (val1 > val2) { cout << "value1 is larger than value2" << endl; } else { cout << "value1 is smaller than value2!" << endl; } system("PAUSE"); return EXIT_SUCCESS; }
if (val1 = val2)
=
==