C program to calculate simple interest

list of programs below: C program to calculate simple interest using functions, C program to calculate simple interest without functions, C program to find total amount after  simple interest.

Simple interest is determined by multiplying the interest rate by the principal by the number of periods. Simple interest is called simple because it ignores the effects of compounding. The interest charge is always based on the original principal, so interest on interest is not included.

simple interest = p r t/100 where p is principal, r is rate of interest and t is time

C program to calculate simple interest using functions without functions
C program to calculate simple interest using functions without functions

Eg. simple interest for principal amount rs 100 at 10 % interest annually is rs. 10. At the end of first year total amount including interest turns to Rs. 110 and at end of second year total amount with interest is 120. simply just add interest of rs. 10 every year to total amount.

Write a c program to calculate simple interest using functions

write a C program to calculate simple interest using functions

#include<stdio.h>
void main()
{
float p;
int t,r;
printf(“Enter principal:\n”);
scanf(“%d”,&p);
printf(“Input rate of interest:\n”);
scanf(“%d”,&r);
printf(“Enter time in years:\n”);
scanf(“%d”,&t);
printf(“simple interest =rs. %f”,simple (p, r, t));
}
// simple interest function
float simple(float p, int r, int t)
{
float si=(p * r * t) / 100;
return (si);
}

OUTPUT:

Enter  Principal:
2000
Input rate of interest:
10
Enter time in years:
2
simple interest =rs. 400

write a C program to calculate simple interest without functions

write a C program to calculate simple interest without functions

#include<stdio.h>
void main()
{
int r,t;
float p,  simple ;
printf(“……To calculate simple interest…..\n”);
printf(“Enter principal:\n”);
scanf(“%d \n”,&p);
printf(“Input rate of interest:\n”);
scanf(“%d \n”,&r);
printf(“Enter time in years:\n”);
scanf(“%d \n”,&t);
simple =(p * r * t) / 100;
printf(“simple interest =rs. %f”, simple );
}

OUTPUT:
……To calculate simple interest…..
Enter  Principal:
1000
Input rate of interest:
10
Enter time in years:
1
simple interest =rs. 100

 

write a c program to find Total Amount (A) to be paid, at end of time period (T),  for a Rate of Interest (R) and Prinipal amount (P)  for debt taken on Simple interest

write a c program to find Total Amount (A) to be paid, at end of time period (T),  for a Rate of Interest (R) and Prinipal amount (P)  for debt taken on compound interest

#include<stdio.h>
#include<conio.h>
// math.h has mathematical functions
#include<math.h>
void main()
{
float p;
int t,r;
float   a;
clrscr();
printf(“…To calculate simple interest…..\t”)
printf(“Enter principal:\t”);
scanf(“%f”,&p);
printf(“Input rate of interest:\t”);
scanf(“%d”,&r);
printf(“Enter time in years:\t”);
scanf(“%d”,&t);
if((p<1)||(t<1)||(r<1))
{
printf(“invalid input”);
}
else
{
a = Total _Amt_SI( p, r, t );
printf(“The Total amount to be paid is %.2f”, a);
}
}
//funtion for Total amt after compount interest

Total _Amt_CI( float prin, int rate, int time)
{
float amt=(prin * rate * time) / 100;
amt=amt+prin;
return amt;
}
}

write a C program to calculate simple interest using structures

write a C program to calculate simple interest using structures

#include<stdio.h>
void main()
{
struct simplevariables
{
int r,t;
float p;
}
struct simplevariables si;
int simple ;
printf(“……To calculate simple interest…..\n”);
printf(“Enter principal:\n”);
scanf(“%d \n”,&si.p);
printf(“Input rate of interest:\n”);
scanf(“%d \n”,&si.r);
printf(“Enter time in years:\n”);
scanf(“%d \n”,&si.t);
simple =(si.p * si.r * si.t) / 100;
printf(“simple interest =rs. %f”, simple );
}

Other programs:

Static variable scope
Register variable scope
External variable scope
Automatic variable scope
amicable number
Prime number
Perfect number
Palindrome number
Strong number
Find Factorial 
Biggest Number
Average of n numbers
convert decimal number to octal
decimal number to hexadecimal
decimal number to binary
simple interest
compound interest
Add sparce matrices
Add matrices
 file copying
Palindrome string
Reverse string
String length
Replace characters in string
substring or not using arrays
First occurrence of character in string
Last occurrence of character in string
Convert to uppercase
Convert to lowercase
Concatenate strings 
Compare strings
Generate Employee payslips
Count students scoring marks>50%
convert weight into grams

Leave a Reply

Your email address will not be published. Required fields are marked *