+ 2

What is the mistake in my c program?please help.

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

20th Apr 2021, 4:11 AM
Nitij Yadav
Nitij Yadav - avatar
10 ответов
+ 2
The warning appears because the variable 'amount' is not being used here.
20th Apr 2021, 4:15 AM
Calvin Thomas
Calvin Thomas - avatar
+ 1
Will you copy the code and correct it and send me please
20th Apr 2021, 4:58 AM
Nitij Yadav
Nitij Yadav - avatar
+ 1
Because in SI I have put bracket so why I should not put bracket in amount like this amount=("Principal + amount "); why?
20th Apr 2021, 6:49 AM
Nitij Yadav
Nitij Yadav - avatar
+ 1
OK thank you for telling me
20th Apr 2021, 3:45 PM
Nitij Yadav
Nitij Yadav - avatar
0
//Created by Nitij Yadav #include <stdio.h> int main() { int principle, time, rate, SI,amount; printf("Enter principle (amount): "); scanf("%d", &principle); printf("Enter time: "); scanf("%d", &time); printf("Enter rate: "); scanf("%d", &rate); SI = (principle * time * rate) / 100; printf("Simple Interest = %d\n", SI); amount=principle+SI; // amount=("principle + SI"); printf("Amount=%d\n",amount); return 0; }
20th Apr 2021, 5:29 AM
Atul [Inactive]
0
Amount variable was not been used in the program
20th Apr 2021, 5:29 AM
Atul [Inactive]
0
Why have not you put the bracket? In SI formula bracket was there so I have done but error was coming why we does not have to put bracket in it?
20th Apr 2021, 6:30 AM
Nitij Yadav
Nitij Yadav - avatar
0
Thanks you for telling me
20th Apr 2021, 6:30 AM
Nitij Yadav
Nitij Yadav - avatar
0
While bracket you are telling?
20th Apr 2021, 6:37 AM
Atul [Inactive]
0
It is a comment u can ignore it
20th Apr 2021, 6:58 AM
Atul [Inactive]