You are on page 1of 1

/* ROLL NO: 1 SEM-1 ICA DIV: A

NAME : VARUN AGGARWAL SUBJECT: FOP


PROGRAM DEFINITION:Write a program to find simple interest

*/

#include<stdio.h>
#include<conio.h>

float si(float,float,float);

int main()
{
FILE *fp;
float p,r,n,sim;
clrscr();
printf("Enter Amount:");
scanf("%f",&p);
printf("Enter Rate:");
scanf("%f",&r);
printf("Enter Years:");
scanf("%f",&n);
sim=si(p,r,n);
fp=fopen("z:\\simple_interest.txt","w");
printf("Simple Interest:%.2f",sim);
Fprintf(fp,"Simple Interest:%.2f",sim);
getch();
return 0;
}

float si(float p,float r,float n)


{
float sip;
sip=(p*r*n)/100;
return sip;
}
/* OUTPUT:
Enter Amount:100000
Enter Rate:1.5
Enter Years:1
Simple Interest:1500.000000
*/

You might also like