A division of one positive integer number by another positive integer number is often performed in elementary schools as repeated subtraction. input two positive integer number ,x and y.Then compute and display the quotient q and the remainder r of x divided y without using any division operator or function(slash operator/modulo operator).
1
Expert's answer
2011-10-14T11:12:24-0400
/*I used a recursive function to calculate the quotient and the remainder.*/
#include<stdio.h> #include<iostream> using namespace std; int x, y, r;
int division(int tempdividend, int tempdivisor) { int q = 1; if (tempdivisor == tempdividend) { r = 0; return 1; } else if (tempdividend < tempdivisor) { r = tempdividend; return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment