+ 3
Paint Costs
#include<stdio.h> int main() { int n,j,t,c; scanf("%d",&n); j= (n*5)+40; t = j*10/100; c = j+t; printf("%d",c); return 0; What is wrong test case 3-4 got failed in Paint Costs problem
4 Answers
+ 5
you need to round it up which is an instruction on the challenge
#include<stdio.h>
#include <math.h>
int main()
{
int n,j,c;
float t;
scanf("%d",&n);
j= (n*5)+40;
t = ceil(j*0.1);
c = j+t;
printf("%d",c);
return 0;
}
+ 1
thanks ā³AsterisKā³ but i had already done it :)
+ 1
Try adding the round() function under math.h header
0
Hello Ambuj Singh.
The truth is I don't know about the C language. I tried to solve it but I can't solve a type error. Your code needs to be rounded according to the instructions. I already imported the math bookstore. I hope that with my little help you can solve it. Check my code.
https://code.sololearn.com/c82EYN9FSeq9/?ref=app