Answer to Question #281385 in C++ for mimi

Question #281385

In or Out

by CodeChum Admin

I'm quite into games now, so how about we play In or Out! When a given number is even, the team scores so we shall print "In", but if it's not an even number, then we print "Out".


1
Expert's answer
2021-12-20T10:02:09-0500
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    
    cout<<"Enter a Number: ";
    cin>>n;
    
    if (n % 2 == 0)
    {
        cout<<"In";
    }
    else
    {
        cout<<"Out";
    }
}

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