what is difference between // and %, please explain with suitable example | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

what is difference between // and %, please explain with suitable example

18th Jul 2016, 3:42 PM
RAVI ABHISHEK
RAVI ABHISHEK - avatar
1 Answer
0
/ gives you quotient in flot with remainder 0 // gives you quotient in only in integer % gives you remainder. 4/2 : 2 4//2 : 2 4%2 : 0 5/2 : 2.5 5//2 : 2 5%2 : 1
5th Nov 2016, 4:00 AM
Dinesh Devaki
Dinesh Devaki - avatar