6th Apr 2020, 4:23 PM
Kuldeep Sahani
5 odpowiedzi
+ 2
Hello Kuldeep Sahani It would be nice if you could explain the issue with your code :) Btw: Please delete this question: https://www.sololearn.com/Discuss/2230062/?ref=app
6th Apr 2020, 4:31 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
https://code.sololearn.com/c0r95wui2Kx7/?ref=app I have changed == to = total was defined two times. Once as float and other time as int Changed some logic to find total and used ceil() function to round the answer
6th Apr 2020, 4:41 PM
Utkarsh Sharma
Utkarsh Sharma - avatar
+ 2
Try using the round() function under math library
11th Jun 2020, 5:22 AM
ANKIT DATTA
ANKIT DATTA - avatar
+ 1
#include <stdio.h> int main() { int cab=40,paint=5; int npaint; float tax=0.1; scanf("%d",&npaint); int tpaint=paint*npaint; float total=cab+tpaint+(cab+tpaint)*tax; printf("%f",total); return 0; } I have done some changes. First, you used "==" instead of "=". Double equal to is used for comparison, but you want to assign the values. So you should use "=". Second, you had defined total in two different types, that is, float and int. So I removed the total in int. Rest you can check. Hope this helps.
6th Apr 2020, 4:32 PM
Taranjeet
Taranjeet - avatar
0
Thanks
6th Apr 2020, 4:35 PM
Kuldeep Sahani