program to get the remainder and quotant of given two
numbers with out using % and / operators?
Answer Posted / mahfooz alam
#include <iostream>
using namespace std;
int main()
{
int a,b;
cout<<"enter two number"<<endl;
int r,q=0,bi,s;
cin>>a>>b;
if(a<b)
{
s=a;
bi=b;
}
else
{
s=b;
bi=a;
}
r=bi-s;
q++;
while(r>=s)
{
q++;
r=r-s;
}//endl of while.*/
cout<<"remainder is "<<r<<" quotient is "<<q<<endl;
return 0;
}
| Is This Answer Correct ? | 13 Yes | 8 No |
Post New Answer View All Answers
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
what do the 'c' and 'v' in argc and argv stand for?
What is the advantage of a random access file?
What is the argument of a function in c?
Why is c called c not d or e?
What is this infamous null pointer, anyway?
Differentiate between the expression “++a” and “a++”?
Explain the use of bit fieild.
What is a memory leak? How to avoid it?
Combinations of fibanocci prime series
What are directives in c?
Why do we use namespace feature?
write a progrmm in c language take user interface generate table using for loop?
Wt are the Buses in C Language
Explain how can you check to see whether a symbol is defined?