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
What is the symbol indicated the c-preprocessor?
What is the difference between array and linked list in c?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
What is the use of bit field?
How do you do dynamic memory allocation in C applications?
Explain is it better to bitshift a value than to multiply by 2?
What are local variables c?
What is the difference between variable declaration and variable definition in c?
How can I swap two values without using a temporary?
What is the use of ?
What is the usage of the pointer in c?
What is wrong in this statement?
What does malloc () calloc () realloc () free () do?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
How to throw some light on the b tree?