0% found this document useful (0 votes)
28 views

Congruence Modulo.: Program 6: Wap To Implement Linear

This C program implements linear congruence modulo. It takes input values for a, b, and n from the user. It then calculates a%n and b%n, and compares the results. If they are equal, it prints that a and b are congruent modulo n and displays the common value. Otherwise, it prints that they are not congruent.

Uploaded by

Akshat jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Congruence Modulo.: Program 6: Wap To Implement Linear

This C program implements linear congruence modulo. It takes input values for a, b, and n from the user. It then calculates a%n and b%n, and compares the results. If they are equal, it prints that a and b are congruent modulo n and displays the common value. Otherwise, it prints that they are not congruent.

Uploaded by

Akshat jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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