Division without using ‘/’ operator?
#include<stdio.h>
void main() {
int a, b, i=0;
printf("Enter the dividend and divisor\n");
scanf("%d%d",&a,&b);
while(a>=b){
a=a-b;
i++;
}
printf("qoutient is :%d \nremainder : %d\n",i,a);
}
output:-
Enter the dividend and divisor
10 2
qoutient is :5
remainder : 0


0 కామెంట్లు