003-001-012

Using Modulus Operator

Medium

Problem Description

Using Modulus Operator

Learning Objective: Understand how to use modulus operator (%) for calculating remainders and applications like even/odd checking

Overview

Use modulus operator for even/odd checking and digit extraction.

Specifications

  • Check and output whether 17 and 24 are even or odd
  • Extract and output the last digit of 456

Output Format

17 is odd
24 is even
Last digit of 456 is 6

Ready to Try Running Code?

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

Don't have an account?