#include
"header.h"
main()
{
float amt,interest;
int year;
float comp_int_calc(float,float,int);
clrscr();
printf("Enter the initial amount: ");
scanf("%f",&amt);
printf("Enter the Number of years: ");
scanf("%f",&year);
interest=comp_int_calc(amt,roi,year);
printf("\nThe int is %.2f",interest);
getch();
}
main()
{
float amt,interest;
int year;
float comp_int_calc(float,float,int);
clrscr();
printf("Enter the initial amount: ");
scanf("%f",&amt);
printf("Enter the Number of years: ");
scanf("%f",&year);
interest=comp_int_calc(amt,roi,year);
printf("\nThe int is %.2f",interest);
getch();
}
file-2.c
#include "header.h"
float comp_int_calc(float x,float y,int z)
{
float i;
i=x*pow((1+y/100),2);
return(i-x);
}
header.h
#include<stdio.h>
#include<math.h>
#define roi 10
Then press Alt+P in Turbo C and enter a project file name, e.g. Q11.prj. Create a new project file of the same name e.g. Q11.prj and enter the following in it-
file-1.c
file-2.c
header.h
Now compile the project file and the desired output will be obtained.