+ 1
for (int i=0; i<3; i++){ a=a-((a*10/100)); }
3rd Apr 2022, 3:08 PM
Jayakrishna 🇼🇳
+ 1
For input less than 100, a/100 return 0 which lead to wrong calculations.. Better to use double type calculations and cast back to int. You're welcome..
3rd Apr 2022, 3:21 PM
Jayakrishna 🇼🇳