Professional Documents
Culture Documents
CONGRUENCE MODULO.
#include <stdio.h>
int main()
{
int a , b , n , c , d;
printf("Enter the value of a : ");
scanf("%d",&a);
printf("Enter the value of b : ");
scanf("%d",&b);
printf("Enter the value of n : ");
scanf("%d",&n);
c = a%n;
d = b%n;
if(c==d) {
printf("\nIt's a congruent modulo\n");
printf("The value is : %d",c);}
else {
printf("Not congruent!");
}
return 0;
}
OUTPUTS: