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...

How to find remainder of two numbers without using (%)
operator

Answer Posted / shubham

using formula "Dividend = Quotient x Divisor + Remainder"
the c++ code for this would be

#include<iostream.h>
void main()
{
int a,b,q,r;
cout<<"Enter a ";
cin>>a;
cout<<"Enter b ";
cin>>b;
q=a/b;
r=a-q*b;
cout<<"Remender="<<r;
}

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The ratio for Boys to Girls is 6:4. 60% of the boys and 40% of girls take lunch in the canteen. What % of class takes lunch in canteen.

1119


Three friends divided some bullets equally. After all of them shot 4 bullets the total no.of remaining bullets is equal to that of one has after division. Find the original number divided.

1132


A is twice efficient than B. A and B can both work together to complete a work in 7 days. Then find in how many days A alone can complete the work?

1171


sum of 5 consecutive numbers is 35. how many of the numbers are prime:

1133


A ship is away from the shore by 180 miles.A plane is travelling at 10 times speed of the ship.How long from the shore will they meet?

1567


A clock is late by 1 minute 27 seconds in a month. Then how much will it be late in 1 day?

1748


A chain is broken into three pieces of equal lengths containing 3 links each. It is taken to a backsmith to join into a single continuous one . How many links are to to be opened to make it ?

2106


A batsman scores 23 runs and increases his average from 15 to 16. Find the runs to be made if he wants top Inc the average to 18 in the same match.

1296


hai frnds pls give me some tips and traps about HP software company interview for freshers.am a B.E CSE fresher.hoe will be the interview?how many days it will be conducted?how will be apps round?technical round?hr round?pls help me if any one known means.send me that pattern by vijay ,chennai

2435


(Momentum*Velocity)/(Acceleration * distance ) find units.

1157


A&B fill 3 litres and 5 litres of oil in the car. C pays Rs. 8/- to A7B. How much will A get?

1407


slur : speech :: smulge : ?

1338


Instead of multiplying a number by 7, the number is divided by 7. What is the percentage of error obtained?

1428


How many 1's are there in the binary form of 8*1024 + 3*64 + 3

1512


hai am Deepak here i have my exam on 3rd jan 2010 for the post of officers job in karnataka bank so kindly plz send me model papers . thank u

3031