How to write a c program to input principal amount, rate and time and calculate simple interest in C Programming ?
Solution:
//Program to input principal amount, rate and time and calculate SI
#include<stdio.h>
#include<conio.h>
void main()
{
float rate, principle, time;
clrscr();
printf("Enter principle, rate and time (in years): ");
scanf("%f%f%f", &principle, &rate, &time);
printf("The simple interest for Rs.%f at rate %f for the duration %f years is: %f", principle, rate, time, principle * rate * time * 0.01);
getch();
}