differiantiate between / and % operator
Answers
Answered by
0
Answer:
% is a modulo operator , It give remainder of two numbers on division as result and discard quotient and gives an integer
eg. 11%4=3
=> 11/4 => 11–(4*2) => 11–8 = 3, remainder is 3 as it is less than 4 .
/ is a division operator , it give quotient of two numbers on division as result and gives a floating point number.
eg. 11/4=2.75
=> 11/4 => 11–(4*2) => 11–8 = 3 => 3/4= 0.75 . so quotient is 2.75
On integer type casting Result will be 2 and on double or float result will be 2.75.
I HOPE it will help you
PLEASE MARK ME AS BRILLIANT and ALSO GIVE ME THANKS pleeeeease
Similar questions