Ticker

6/recent/ticker-posts

Find reminder without using modulus operator || C Programming

Find reminder without using modulus operator || C Programming 


#include <stdio.h>

int main()

{

 int n,d,r,q;

 printf("enter the a and b values\n");

 scanf("%d %d",&n,&d);


q=n/d;

r= n-(d*q);

printf("without using modulus %d\n",r);

printf("using with modulus %d\n",n%d);

}


output:-

enter the a and b values

10 2

without using modulus 0

using with modulus 0

కామెంట్‌ను పోస్ట్ చేయండి

0 కామెంట్‌లు