+ 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; }
11 Réponses
+ 16
what is the error..!?
+ 14
c++soldoier
+ 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;
}
+ 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.
+ 5
try again Rahaf Abuqwaider
+ 5
COPY AGAIN FROM MY COMMENT AND THEN RUN THE CODE !
+ 4
1) Don't start with capital letters.
2) == instead of = for comparisons, otherwise it is an assignement in your case
+ 3
Rahaf Abuqwaider do share your code or error you are getting
+ 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;
}
+ 1
C++ Soldier (Babak) i've copied it and still get errors
- 2
C++ Soldier (Babak) 4 times and nothing has changed 💔