Anybody can explain me why is output 36 | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grátis
0

Anybody can explain me why is output 36

https://code.sololearn.com/W1P6t4J8RHcg/?ref=app

8th Oct 2020, 9:23 PM
Тимур Завьялов
Тимур Завьялов - avatar
5 Respostas
+ 2
During first loop prod=prod*326%10=1*6=6 x=(x-x%10)/10=(326-326%10)/10=(326-6)/10=320/10=32 During second loop prod=prod*32%10=6*2=12 x=(x-x%10)/10=(32-32%10)/10=(32-2)/10=30/10=3 During third loop prod=prod*3%10=12*3=36 x=(x-x%10)/10=(3-3%10)/10=(3-3)/10=0/10=0 Loop stops
8th Oct 2020, 9:33 PM
Abhay
Abhay - avatar
8th Oct 2020, 9:57 PM
Abhay
Abhay - avatar
0
Abhay, but it written 326
8th Oct 2020, 9:41 PM
Тимур Завьялов
Тимур Завьялов - avatar
0
Тимур Завьялов yup sorry result would be same still ,I will edit it
8th Oct 2020, 9:49 PM
Abhay
Abhay - avatar
0
Abhay, but I have a result is 32, tell me why?
8th Oct 2020, 9:53 PM
Тимур Завьялов
Тимур Завьялов - avatar