Friday 20 January 2012

Simple Programs in C

Let us now write down our second C program.It would simply calculate simple interest for a set of values representing principle,number of years and interest.
/*Calculating of simple interest*/
#include<stdio.h>
#include<conio.h>
int main()
{
int p,n;
float r,si;
p=1000;
n=3;
r=8.5;
/*formula for simple interest*/
si=p*n*r/100;
printf("%f\n",si);
return 0;


No comments:

Post a Comment