Basic

Switch Case

Goto

Operators

if Statement

Nested if

While Loop

For Loop

Array

Patterns

Excersises


Calculate simple interest in C Program


Simple Interest (S.I) Formula

simple interest in c program
  • P - Pricipal Amount
  • R - Interest Rate
  • T - Time (in Years)

Example : pgm.c

#include<stdio.h>
int main(){
    float p,r,t,si;
    printf("\nEnter Principal Amount : ");
    scanf("%f",&p);
    printf("\nEnter Interest Rate (%%) : ");
    scanf("%f",&r);
    printf("\nEnter Time (Years): ");
    scanf("%f",&t);
    si=(p*r*t)/100;
    printf("\nSimple Interest : %0.2f",si);
    return 0;
}

Output:

Enter Principal Amount : 10000
Enter Interest Rate(%) : 2.5
Enter Time (Years) : 3

Simple Interest : 750.00