top of page
Modulus
The modulus operator % is used t return the remainder of a number.
(For example 5%2 will return 1 because 2 will go into 5 once while leaving one by itself)
Many advanced programs take advantage of the modulus operator. We will make a simple program which will check if a user-input number is prime or not.
Example:
Output:


bottom of page