C++ program to read (X) and then disting uish either X is an odd or even if number double operator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

C++ program to read (X) and then disting uish either X is an odd or even if number double operator

27th Oct 2022, 4:59 PM
Younis Ahmad
Younis Ahmad - avatar
6 Answers
+ 2
take input as string and take refrence to my code below https://code.sololearn.com/c65XRCvhCtsO/?ref=app
28th Oct 2022, 7:19 PM
Sunil Shrestha
Sunil Shrestha - avatar
0
Please help me
27th Oct 2022, 4:59 PM
Younis Ahmad
Younis Ahmad - avatar
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"?
27th Oct 2022, 5:49 PM
Apollo-Roboto
Apollo-Roboto - avatar
0
Double num; Cin>>num; if(num%2==0) { cout<<´´even´´; } else { Cout<<´´odd´´; }
27th Oct 2022, 5:51 PM
Younis Ahmad
Younis Ahmad - avatar
0
Like this how i can solve?
27th Oct 2022, 5:52 PM
Younis Ahmad
Younis Ahmad - avatar
- 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.
28th Oct 2022, 3:53 AM
Emerson Prado
Emerson Prado - avatar