BC201 - Editorial

#PROBLEM LINK:

Practice
Contest

Author: Ayush Nagal

#DIFFICULTY:
CAKEWALK

#PREREQUISITES:
Math

#PROBLEM:
Given an integer n, print the last digit of n.

#EXPLANATION:
We can simply do it using the % operator as shown:

cin>>n;
cout<<n%10;

#AUTHOR’S SOLUTION:
Author’s solution can be found here.

1 Like