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
A, B, C made trips to PIZZA centre B made 2.4 times more trips then ! , C made 6 more then A Total Min trips are
(7*7=49)(4*9=36)(3*6=18) (1*8=8)
A car is filled with four and half gallons of fuel for a round trip.If the amount of fuel taken while going is 1/4 more than the amount taken for coming, what is the amount of fuel consumed while coming back?
If Log2 x - 5 Log x + 6 = 0, then what would the value / values of x be?
02: 1/3 of girls , 1/2 of boys go to canteen .What factor and total number of classmates go to canteen?
3x+4y=10, x3 + y3=6, What is the minimum value of 3x+11y=?
which of the following leaders was not among the moderates
From 5 different green balls, four different blue balls and three different red balls, how many combinations of balls can be chosen taking at least one green and one blue ball?
There are 4 boys and 3 girls. What is the probability the boys and girls sit alternately?
Find the next letter in the series O,T,T,F,F,S,S--
A sequence is given. You should find out error & write correct 1 2 5 10 13 26 29 48.
If the equation x2 - 3x + a = 0 has the roots (0,1) then value of a is ?
Find sqrt of 113 up to 3 decimal places.
A person went to shop and asked for change for 1.15 paise. But he said that he could not only give change for one rupee but also for 50p, 25p, 10p and 5p. What were the coins he had ?
Girish invested a certain amount at the rate of 8% p.a. for 6 year to obtain an amount of Rs. 28046.How much amount did Girish obtain as simple interest?