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
Where in memory are my variables stored?
How many keywords are there in c?
What is a stream?
How many main () function we can have in a project?
How to find a missed value, if you want to store 100 values in a 99 sized array?
What is the use of define in c?
What is the advantage of using #define to declare a constant?
What is stack in c?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
What is the purpose of realloc()?
Is sizeof a keyword in c?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
Differentiate between #include<...> and #include '...'
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..