0
What is wrong in this ?
#include <iostream> using namespace std; int main() { int a; int b; int p = a + b; cout<<"inter a number"<<cin>>a; cout<<"inter another number"<<cin>>b; cout<<p; return 0; }
2 Answers
+ 3
1) dont add uninitialized numbers (int p=a+b)
2) you cannot use cin with cout object (and opposed)... use cout, then in another expression, use cin
3) Order in you case is wrong... You must get a and b from cin, then add they and last show sum (you sum first, after get they and show last)
+ 1
thanks
i'll try again