You are on page 1of 2

PROGRAM 6: WAP TO IMPLEMENT LINEAR

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:

AKSHAT JAIN 1703013008


AKSHAT JAIN 1703013008

You might also like