text: Modulo Operator ( % ) in C / C ++ with Examples | Program to illustrate the working of the modulo operator ; To store two integer values ; To store the result of the modulo expression
code: #include <stdio.h> NEW_LINE int main ( void ) { int x , y ; int result ; x = -3 ; y = 4 ; result = x % y ; printf ( " % d " , result ) ; x = 4 ; y = -2 ; result = x % y ; printf ( " % d " , result ) ; x = -3 ; y = -4 ; result = x % y ; printf ( " % d " , result ) ; return 0 ; }