Find simple interest

Program:

#include<stdio.h>
int main()
{
float p,r,n,i;
printf("Enter principle amount: ");
scanf("%f",&p);
printf("Enter rate of interest: ");
scanf("%f",&r);
printf("Enter number of years: ");
scanf("%f",&n);
i=(p*r*n)/100;
printf("Simple Interest is : %.2f",i);
return 0;

}

Output:


No comments:

Post a Comment

x^y using recursion

Program: #include<stdio.h> int power(int a,int b); int main() { int x,y,ans; printf("Enter x and y:\n "); scanf(...