[Solved] Paint cost 2/5 failed | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

[Solved] Paint cost 2/5 failed

#include <stdio.h> int main() { int colours, total, other_stuff=40, final, tax; scanf("%d",&colours); total = (colours*5) + other_stuff ; tax = total/10; final = tax + total; printf ("%d",final); return 0; } 2 out of 5 case failed Pls help

7th May 2020, 1:09 AM
Saaquib Motiwala
2 Answers
+ 2
Coder Kitten Is there any way without using ceil?
7th May 2020, 2:27 AM
Saaquib Motiwala
+ 2
Coder Kitten #include <stdio.h> #include <math.h> int main() { int colours, total, other_stuff=40, a; double tax, final; scanf("%d",&colours); total = (colours*5) + other_stuff ; tax = total/10.0; final = tax + total; a = ceil(final); printf ("%d",a); return 0; } This is the new code and it works thank you
7th May 2020, 2:54 AM
Saaquib Motiwala