0

Can anyone help me out to find the error over here to calculate the simple interest

#include <stdio.h> main() { float p,r,t,i; printf ("enter the no. of year"); scanf("%f",t); printf ("enter the principal amount"); scanf("%f",p); printf ("enter the rate of interest"); scanf("%f",r); i=(p*r*t)/100; printf("the total interest %f",i); return(0); }

8th Feb 2020, 2:28 PM
Tutankhamun
2 Réponses
+ 2
You have missed the ampersand (&) operator while taking user input. It should be- scanf("%f", &t);
8th Feb 2020, 2:37 PM
Avinesh
Avinesh - avatar
0
Please try not make multiple threads under similar topics, it will help in reducing duplicate questions 👍 https://www.sololearn.com/Discuss/2162622/?ref=app
8th Feb 2020, 3:07 PM
Ipang