program to get the remainder and quotant of given two
numbers with out using % and / operators?
Answer Posted / brad
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,r1,r2,count=0;
printf("Enter two numbers\n");
scanf("&d,&d",a,b);
if(a>b)
{
r1=a;
r2=b;
}
else
{
r1=b;
r2=a;
}
do
{
res=r1-r2;
r1=res;
count++;
}
while(r1>=r2);
printf("the remainder is ",res);
printf("the quotient is ",count);
}
| Is This Answer Correct ? | 3 Yes | 8 No |
Post New Answer View All Answers
Can you apply link and association interchangeably?
What does a function declared as pascal do differently?
What does the c in ctime mean?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
What is a pointer and how it is initialized?
What do you understand by normalization of pointers?
What is union and structure in c?
What is the benefit of using #define to declare a constant?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
Explain two-dimensional array.
How can I determine whether a machines byte order is big-endian or little-endian?
Where can I get an ansi-compatible lint?
What is pragma in c?
What is string function c?
What is malloc and calloc?