in Programming in C
6,475 views
4 votes
4 votes
Let a, b be two positive integers, which of the following options correctly relates / and %?

(a) b= (a/b) * b + a%b

(b) b= (a%b) * b + a/b

(c) a= (a/b) * b + a%b

(d) a= (a%b) * b + a/b

* I am getting answer as c but the answer given is b. Please tell me which one is correct.
in Programming in C
6.5k views

3 Answers

3 votes
3 votes
Answer is option C only since it is the basic law of division

Dividend =quotient * Divisor + Remainder
1 vote
1 vote
Yes, it seems like you are right.

Option C should be the correct Answer.

Check for

1) b = 1

2) a = b.

All the options except C) are dead on at least one of the above substitutions.

1 comment

yes, option C seems right
0
0
0 votes
0 votes
You can simply check for a=6 & b=3 or any number.

(a) b=(a/b) *b + a%b gives b=6 but here b=3 so not true.

similarly check for options b,c & d. Only option (c) will give you right answer.

Related questions