Topic: C++ code
hello
i wrote code in C++ , it's make these steps :
1: Print (Random number) = X + Y
2: Request X and Y value from user
3: Print right if X and Y value is right
code :
#include <iostream.h>
#include <cstdlib>
int X,Y,result,q,w;
int main(int argc, char *argv[]) {
result = rand();
cout << result << " = X + Y" << endl;
cout << "X = " << endl;
cin >> X;
cout << endl;
cout << "Y = " << endl;
cin >> Y;
cout << endl;
w = X+Y;
if (w == result) {
cout << "thats right :) , press any key and enter to exit" << endl;
cin >> q;
}
else {
cout << "wrong ! , press any key and enter to exit";
cin >> q;
}
}