0

C++ code playground not working

The C++ code playground not working. Once I press run it says compilation error. Am I the only one having this problem?

2nd Jul 2018, 7:37 AM
Simar
Simar - avatar
8 Answers
+ 4
error : cout >>sum>>endl; correct syntax: cout <<sum<<endl; // change >> to <<
2nd Jul 2018, 8:00 AM
Nikhil Dhama
Nikhil Dhama - avatar
+ 2
Post the link to your code, so we can help.
2nd Jul 2018, 7:45 AM
Nikhil Dhama
Nikhil Dhama - avatar
+ 1
Your streams are reversed cout << sum << endl; You can eadily remember this by looking at this as an arrow, data flows from your variables to the cout stream. For cin, its opposite, from the cin stream to your vars cin >> x;
2nd Jul 2018, 8:01 AM
Udi Finkelstein
Udi Finkelstein - avatar
0
Compilation error. Is there anything wrong with the c++ code?
2nd Jul 2018, 7:39 AM
Disvolviĝo;
Disvolviĝo; - avatar
0
no i checked everything if i put something wrong it shows what i did wrong
2nd Jul 2018, 7:41 AM
Simar
Simar - avatar
0
Can you show me the code?
2nd Jul 2018, 7:43 AM
Disvolviĝo;
Disvolviĝo; - avatar
0
heres a simple one but it doesnt work either #include <iostream> using namespace std; int main() { int a = 7; int b = 8; int sum = a+b; cout >> sum >> endl; return 0; }
2nd Jul 2018, 7:58 AM
Simar
Simar - avatar
0
i just tried it and now its fine! thank you!!
2nd Jul 2018, 8:02 AM
Simar
Simar - avatar