Today I learned how to make variables using variable I made a simple calculator and it worked the first time I tried.
Here is the code for it if you would like to try just copy it into a compiler and compile it and you have a basic calculator
#include
using namespace std;
int main()
{
int a;
int b;
int sum;
cout << "Enter a number! \n";
cin >> a;
cout << "Enter another number \n";
cin >> b;
sum = a + b;
cout << "the sum of those numbers is " << sum << endl;
return 0;
}
No comments:
Post a Comment