How its answer is 10.0 please tell me with the full process | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How its answer is 10.0 please tell me with the full process

print((5 * ((25 % 13) + 100) / (2 * 13)) // 2)

19th May 2021, 7:28 AM
सुमित भण्डारी
सुमित भण्डारी - avatar
5 Answers
+ 3
25%13=12 12+100=112 equation is now simplified to , (5*112/(2*13)) //2 2*13=26, equation is now as follow, (5*112/26) //2 112/26=4.307.. 5*4.307=21.5384.. 21.5384//2=10.0 ,"//" is a floor division operator that will round off to a whole number which is less than normal division result , i.e. 10.7692 is round off to 10.0
19th May 2021, 7:39 AM
Abhay
Abhay - avatar
+ 2
First the inner paranthesis will be calculated first. (25%13)+100 = 12+100 = 112 2*13=26 ((25%13)+100 )/(2*13) = 112/26= 4.30 ((25%13)+100 )/(2*13)//2 = 2.0 The operator // is floor division and it will always ignore the decimal part in the output.. (5*((25%13)+100 )/(2*13)//2)=5*2.0 =10.0
19th May 2021, 7:38 AM
Manikandan
Manikandan - avatar
+ 2
Print ((5*((25%13)+100)/(2*13))//2) ((5*(12+100)/26)//2) ((5*112/26)//2) (21.53//2) 10.0, "//"operater ignore decimal part
20th May 2021, 2:56 PM
RUDRA PRATAP CHAUHAN
RUDRA PRATAP CHAUHAN - avatar
+ 2
Follow BODMAS RULE FIRST CONSIDER BRACKETS (25%13)=12 THEN ADD 100 TO IT 12+100=112 THEN (2*13)=26 THEN DIVISON 112/26=4.30 THEN FLOOR DIVISON 4.30//2=2.0 THEN WE ARE LEFT WITH MULTIPLICATION 5*2.0=10.0 .
21st May 2021, 6:23 AM
Gajula Raja Gopal
Gajula Raja Gopal - avatar
+ 1
सुमित भण्डारी #How its answer is 10.0 please tell me with the full process print ((5 * ((25 % 13) + 100) / (2 * 13)) // 2) print ((5 * (12 + 100) / 26) // 2) print ((5 * 112 / 26) // 2) print ((560 / 26) // 2) print (21.538 // 2) # // is known as floor division so output will be 10.0
19th May 2021, 7:40 AM
A͢J
A͢J - avatar