+ 1
What's the problem in this code?
#include <iostream> using namespace std; int main() { int a, b; int sum = a + b; cout << "Enter a number \n"; cin >> a; cout << "Enter another number \n"; cin >> b; cout << sum; return 0; }
2 Answers
+ 3
You just need to move âint sum = a + b;â after your final cin. You have to specify what A & B are before you can add them
https://code.sololearn.com/cEOGvea73Vqc/?ref=app
+ 1
Thanks Jax