C-Program to calculate simple and compound interest
Sample Input
Enter the value of Principal p = 1000
Enter the value of Rate r = 12
Enter the value of Period in year n = 2
Sample Output
Simple Interest SI=240.000000
Compound Interest CI=254.400009
Enter the value of Principal p = 1000
Enter the value of Rate r = 12
Enter the value of Period in year n = 2
Sample Output
Simple Interest SI=240.000000
Compound Interest CI=254.400009
WAP that calculates the Simple Interest and Compound Interest. The Principal , Amount, Rate of Interest and Time are entered through the keyboard.
Input
#include<stdio.h> void main() { float p,r,t,i; clrscr(); printf("Enter principal amount : "); scanf("%f",&p); printf("\nEnter Rate of Interest : "); scanf("%f",&r); printf("\nEnter time period : "); scanf("%f",&t); i=(p*r*t)/100; printf("\nInterest calculated is %f",i); getch(); }
Output
Enter principal amount : 5000 Enter Rate of Interest : 10.5 Enter time period : 7 Interest calculated is 3675.000000
No comments:
Post a Comment