Modulus is remainder of division:
Example of using of modulus operator on C programming syntax:
main()
{
printf("%d", 11 % 4);
getch();
}
- 6:3 = 2 and have remainder 0, then 6 modulus 3 = 0
- 5:2 = 2 and have remainder 1, then 5 modulus 2 = 1
- 11:4 = 2 and have remainder 3, then 11 modulus 4 = 3
Example of using of modulus operator on C programming syntax:
main()
{
printf("%d", 11 % 4);
getch();
}
0 komentar:
Posting Komentar