Skip to content

A program designed to evaluate the place values of a three digit number.

Notifications You must be signed in to change notification settings

khalilfrancis/place_value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

A simple program that prints the corresponding place value of each digit in a three-digit number stored in user_val.

This serves as a gentle, but informative excercise to challenge my understanding of the MODULO operator (%).

Now, you may ask: "What is the MODULO operator?"

Well, MODULO is a basic arthmetic operator (i.e., +,-,*,/) that evaluates the remainder of the division of two integer operands.

For example:

  • 18 % 10 is 8. Why? Because 18 / 10 is 1 with a remainder of 8.
  • 90 % 90 is 0. Because 90 / 90 is 1 with a remainder of 0.
  • 1 % 2 is 1. Because 1 / 2 is 0 with a remainder of 1.
  • 100 % (1 // 2) is undefined. Because using PEMDAS, (1 // 2 ) evaluates to 0. 100 % 0 is undefined (as 100 / 0 is undefined), thus causing the program to terminate.

About

A program designed to evaluate the place values of a three digit number.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages