difference between /and %
Answers
Explanation:
What is the difference between % and / in C programming?
13 Answers

Vipul Kumar Maurya, B.tech(CSE)
Answered August 5, 2017
In C/C++
% 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.
Answer:
Explanation:
/
1. It is known as "slash".
2.Slashes are used in abbreviations like “a/c”
%
1. It is known as "percentage".
2. Percentage is used for calculating portions.