Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1127


what do the 'c' and 'v' in argc and argv stand for?

1176


What is the advantage of a random access file?

1206


What is the argument of a function in c?

1056


Why is c called c not d or e?

1103


What is this infamous null pointer, anyway?

1064


Differentiate between the expression “++a” and “a++”?

1258


Explain the use of bit fieild.

1146


What is a memory leak? How to avoid it?

1352


Combinations of fibanocci prime series

1621


What are directives in c?

977


Why do we use namespace feature?

1063


write a progrmm in c language take user interface generate table using for loop?

2055


Wt are the Buses in C Language

3221


Explain how can you check to see whether a symbol is defined?

1210