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 a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
how we can make 3d venturing graphics on outer interface
Is array name a pointer?
Are pointers integers in c?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
What are formal parameters?
can anyone suggest some site name..where i can get some good data structure puzzles???
What is the value of c?
What is storage class?
What is extern c used for?
Is it valid to address one element beyond the end of an array?
What is the difference between procedural and functional programming?
Can we change the value of constant variable in c?
Tell me is null always defined as 0(zero)?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com