+ 1
C++ program to read (X) and then disting uish either X is an odd or even if number double operator
6 Réponses
+ 2
take input as string and take refrence to my code below
https://code.sololearn.com/c65XRCvhCtsO/?ref=app
0
Please help me
0
this stuff is in the lessons, if you are having trouble, feel free to read them another time.
checking if even or odd is done with x%2 == 0
what do you mean by "if number double operator"?
0
Double num;
Cin>>num;
if(num%2==0)
{
cout<<´´even´´;
}
else
{
Cout<<´´odd´´;
}
0
Like this how i can solve?
- 1
Younis Ahmad Yes, that's the way. Put it in Code Playground and test it.
But first double check:
1. The statements, types, etc., are lower case. There are no "Double", "Cin" or "Cout".
2. Use regular quotes in cout. Those fancy ones will give you a syntax error.