C Modulo Operation. C modulus operator is used to find the remainder of the 2 numbers. Modulo operator in c with examples is discussed in this article.
Modulo operator (%) in c/c++ with examples. This is always integer only. Modulo operations might be implemented such that a division with a remainder is calculated each time.
Consider the following program which takes a number from user and calculates the remainder of the number with divided by 3.
In depth analysis on arithmetic operators. A % b = c which means, when a is divided by b it gives the remainder c, 7%2 = 1, 17%3 = 2. If the numbers are float or double the the modulus operators. Consider the following program which takes a number from user and calculates the remainder of the number with divided by 3.
Nessun commento:
Posta un commento