To Find Modulus Of Two No. Without Using Modulus Operator
#include<stdio.h>
void main()
{
int n1,n2,res,result;
clrscr();
printf("\n Enter First No. ");
scanf("%d",&n1);
printf("\n Enter Second No. ");
scanf("%d",&n2);
res = n1/n2;
result = n1-(n2*res);
printf("\n The Modulus Of %d and %d is %d . ",n1,n2,result);
getch();
}
void main()
{
int n1,n2,res,result;
clrscr();
printf("\n Enter First No. ");
scanf("%d",&n1);
printf("\n Enter Second No. ");
scanf("%d",&n2);
res = n1/n2;
result = n1-(n2*res);
printf("\n The Modulus Of %d and %d is %d . ",n1,n2,result);
getch();
}
Comments
Post a Comment