0

Sololearn - Countdown Project C++

N % 5 == 0 Can someone explain to me how this formula can determine the variables can multiple to 5? Thanks

12th Aug 2021, 3:09 PM
Al3xooom
Al3xooom - avatar
3 Antworten
+ 1
U know in mathematics how we finding multiple check all multiple of 5 it will completely divisible by 5 means if u divide any number which us divisible by 5 completely it will give remainder zero . And here N%5 = Remainder
12th Aug 2021, 3:15 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
The purpose of the == 0 is to validate if the N do not have a remainder?
12th Aug 2021, 3:19 PM
Al3xooom
Al3xooom - avatar
0
Here use of Modulous Operatior which gives the result remainder, and if any number is divided by a number and it gives remainder zero means it is divisible by that number
12th Aug 2021, 3:28 PM
Abhishek Kumar
Abhishek Kumar - avatar