C Programming Tutorial

Advertisements

Write program to calculate and display simple interest in C



       #include<stdio.h>
       #include<conio.h>
       void main()
       {

              int pr,ty;
              float rt,si;
              clrscr();
              
              printf("\nEnter principal : "); 
              scanf("%d",&pr);

              printf("\nEnter rate : "); 
              scanf("%f",&rt);

              printf("\nEnter time : "); 
              scanf("%d",&ty);

              si = (pr * rt * ty) /100;
              
              printf("\nThe simple interest is : %f",si);

              getch();
       }




Advertisement