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



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

Answer / 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

More General Aptitude Interview Questions

In a certain code, ?BELIEF? is written as ?AFKKDI?. How is ?SELDOM? written in that code ? (A) RDKCNL (B) TFKENP (C) RFKENM (D) RFKFNP (E) None of these

3 Answers  


The IT giant Tirnop has recently crossed a head count of 150000 and earnings of $7 billion. As one of the forerunners in the technology front, Tirnop continues to lead the way in products and services in India. At Tirnop, all programmers are equal in every respect. They receive identical salaries ans also write code at the same rate.Suppose 12 such programmers take 12 minutes to write 12 lines of code in total. How many lines of code can be written by 72 programmers in 72 minutes?

12 Answers   TCS,


Low temperature at the night in a city is 1/3 more than 1/2 hinge as higher temperature in a day. Sum of the low temp and highest temp is 100c. Then what is the low temperature

0 Answers   TCS,


Two persons start at the same point, walk in opposite directions with 5km/hr and 5.5km/hr respectively. What is the distance separated after 2 and half hrs?

0 Answers   Hexaware,


f(X)= 2X-1 + f(X-1) if X is not equal to zeroandiff(X=0)=0, If f(f(X))=81 then the value of X=?

0 Answers   CTS,


13_46_8_180_210_75 = 64 . Use + and – in the empty places to make the equation holds good. Take m = number of + and n = number of – . Find m – n?

0 Answers   Infosys,


10men and 10 women are there, they dance with each other, is there possibility that 2 men are dancing with same women and vice versa?

2 Answers   TCS,


Which is the largest prime number that can be stored in a 9-bit register?

0 Answers   Accenture,


A certain street has 1000 buildings. A sign-maker is contracted to number the houses from 1 to 1000. How many zeroes will he need?

6 Answers   Accenture,


ram sita hai ,to sita kaun hai?

8 Answers  


Four Members A, B, C, D are playing a game .A person losing a game should double the amount of others .B, C, D are losing in order after three games .The amount after 3 games are A&B having 40,D is having 16&C 80. Who started with small amount of money?

0 Answers   Accenture,


If we will give you an oppurtunity to join with our bank- whom will you give preference in terms of profit- BANK OR CLIENT??

3 Answers  


Categories