Answer to Question #285123 in C++ for Lex

Question #285123



Instructions:



Input one integer.


Print out the integer in one line.


Check whether the integer is odd or not. If it is odd, print "Odd".



Input



A line containing an integer



5



Output



The first line contains the inputted integer.


The second line contains a string which is the result.



5


Odd

1
Expert's answer
2022-01-07T01:49:49-0500
#include <iostream>


int main()
{
    int num1;
    std::cin>>num1;
    std::cout<<num1<<std::endl;
    if(num1 % 2 == 0)
    {
        std::cout<<"Even"<<std::endl;

    }
    else
    {
        std::cout<<"Odd"<<std::endl;
    }
    
    
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog