+ 1

Please tell me the mistake I Am Doing In This Code .

https://code.sololearn.com/cV7j6PbjLiV4/?ref=app

13th Apr 2017, 9:46 AM
Rahul Sonia
Rahul Sonia - avatar
6 Answers
+ 6
#include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; cout << a << b; return 0; } Your mistake is: cout << "a" << "b"; there should be no quotation marks
13th Apr 2017, 10:00 AM
MrCoder
MrCoder - avatar
+ 2
#include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; cout << a << b; return 0; } You just need to remove the " " from around a and b, When it was "a" it was printing the string a rather than the variable a.
13th Apr 2017, 9:57 AM
Jason Merrett
Jason Merrett - avatar
+ 1
thank you jason
13th Apr 2017, 9:58 AM
Rahul Sonia
Rahul Sonia - avatar
+ 1
@Rahul Sonia No worries :)
13th Apr 2017, 9:59 AM
Jason Merrett
Jason Merrett - avatar
+ 1
thank u all
13th Apr 2017, 10:01 AM
Rahul Sonia
Rahul Sonia - avatar
0
see carefully in code that you are typing extra spaces or not! like int a, b; or cout<< or cout <<
13th Apr 2017, 11:30 AM
pooja
pooja - avatar