005-002-011

If-Else: Even or Odd

Easy

Problem Description

If-Else: Even or Odd

In this problem, you will create a program that reads an integer from standard input, uses an if-else statement with the modulo operator (%) to determine whether the number is even or odd, and displays the result to standard output.

Learning Objective: Implement conditional branching combining if-else with modulo operator

Overview

Create a program that determines whether a given number is even or odd.

Input

Integer num (one line)

Specifications

  • Read integer num from standard input
  • Use if-else statement to check even/odd
  • Output "Even" if even, "Odd" if odd

Output Format

Even

or

Odd

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up