0

What did I do wrong?

#include <iostream> using namespace std; int main() { int a; int b; cin>>"a">>"b"; if{a>b}<<cout<<"you lose" return 0; }

5th Feb 2018, 8:08 AM
Dokko Krash
Dokko Krash - avatar
2 Answers
+ 6
Why do you wanna store the values in a string?? Store them in a variable. Hence: cin>>a>>b;, not cin>>"a">>"b; And: if (a>b){cout<<"you lose";} not if {a>b}<<cout<<"you lose"; That's how if-statements work
5th Feb 2018, 8:18 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
thank you! sorry I'm a novice and just wanted to try new things I learned.
5th Feb 2018, 8:21 AM
Dokko Krash
Dokko Krash - avatar