GSFEB18B - Editorial

PROBLEM LINK :

Contest

DIFFICULTY :

Cakewalk

PREREQUISITES :

Arithmetic Operators

PROBLEM:

Print all the numbers from the input that do not contain ‘7’ in the units place.

EXPLANATION :

The problem demands us to check if the input number contains the digit ‘7’ in the units place.
This can be achieved by using the modulo(%) operator. The simple task is to check if ai%10 is equal to 7. If it is equal to 7 the ai must not be printed in the output, else it should be printed.

AUTHOR’S AND TESTER’S SOLUTIONS :

Solution to this problem is available here.