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

There is a carem board where 4 No of player can play at a time but 5 No of player have to play each to every. In this case how many minimum game will be play.?

2 Answers  


In a colony there are some families. Each of them have children but different in numbers.Following are conditions a> no of adult>no of sons>no of daughters>no of families. b>each sister must have atleast one brother and should have at the most 1 sister. c> no of children in one family exceeds the sum of no of children in the rest families Tell the no of families

1 Answers   Cognizant,


if the ratio of men to women in a particular dormitory is 5:3 which of the following could not be the number of residents in the dormitory

1 Answers  


What is difference between public sector bank and government bank?

2 Answers  


first day of 1999 is sunday.what day is the last day?

8 Answers   BNY Mellon, TCS,


In covering a distance of 30 km, abhay takes 2 hours more than sameer. If abhay doubles his speed, then he would take 1 hour less than sameer. Abhay's speed is?

0 Answers  


I'm also facing the same problem. plz send me model question papers and answers which help me to face interview for clerical staff in sbi.

1 Answers  


On Monday a manufacturer processed a batch of bats, on Tuesday he processed three times as many, and on Wednesday he processed 4000 bats. In the three days, He processed 16000 bats. How many did he process on Tuesday?

0 Answers   Cap Gemini,


sqrt(0.16)+cubic root(0.027) equals

0 Answers   DSQ Software,


Supposing a clock takes 7 seconds to strike 7. How long will it take to strike 10?

1 Answers   Infosys,


two, trains, one from howrah to patna and the other from patna to howrah, start simultaneously. After they meet, the trains reach their destinations after 9 hours and 16 hours respectively. What is the ratio?

0 Answers  


they asked the temperature problem.it was same as previous papers.the ratio was -t*t/6+4t+12.

0 Answers   Accenture,


Categories