+ 7

What is the wrong here, help me please!!

#include <iostream> Using namespace std; Int main () { Int a; Cin >> a; If (a % 2 =0) Cout << "even"; Else Cout << "odd" ; Return 0; }

1st Aug 2018, 8:39 PM
Rahaf Abuqwaider
Rahaf Abuqwaider - avatar
11 Answers
+ 16
what is the error..!?
1st Aug 2018, 8:45 PM
Genes Sambayena
Genes Sambayena - avatar
+ 14
c++soldoier
18th Aug 2018, 2:30 AM
Abdiwali Mukhtar Mohamed
Abdiwali Mukhtar Mohamed - avatar
+ 8
Rahaf Abuqwaider #include <iostream> using namespace std; int main () { int a; cin >> a; if (a % 2 == 0) cout << "even"; else cout << "odd" ; return 0; }
1st Aug 2018, 9:37 PM
Babak
Babak - avatar
+ 6
Rahaf Abuqwaider I've tried it out (in code blocks) and it works... take good care of the curly braces... #include <iostream> using namespace std; int main(){ int a; cin >> a; if ((a%2)==0){ cout << "even" <<endl; } else{ cout << "odd" <<endl; } return 0; } please make sure that the cases & braces are handled correctly. if it fails please share the error you get.
2nd Aug 2018, 12:16 AM
Mark đŸ‡ș🇬 [INACTIVE]
Mark đŸ‡ș🇬 [INACTIVE] - avatar
+ 5
1st Aug 2018, 9:40 PM
Babak
Babak - avatar
+ 5
COPY AGAIN FROM MY COMMENT AND THEN RUN THE CODE !
1st Aug 2018, 9:45 PM
Babak
Babak - avatar
+ 4
1) Don't start with capital letters. 2) == instead of = for comparisons, otherwise it is an assignement in your case
1st Aug 2018, 8:53 PM
Matthias
Matthias - avatar
+ 3
Rahaf Abuqwaider do share your code or error you are getting
2nd Aug 2018, 1:40 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 3
Dont capitalize every thing example: For and for is totally differeent in c++ and many other programming languages . #include <iostream> using namespace std; int main () { int a; cin >> a; if (a % 2 ==0) cout << "even"; else cout << "odd" ; return 0; }
24th Jul 2019, 5:54 PM
shaalle
shaalle - avatar
+ 1
C++ Soldier (Babak) i've copied it and still get errors
1st Aug 2018, 9:40 PM
Rahaf Abuqwaider
Rahaf Abuqwaider - avatar
- 2
C++ Soldier (Babak) 4 times and nothing has changed 💔
1st Aug 2018, 9:44 PM
Rahaf Abuqwaider
Rahaf Abuqwaider - avatar