Friday, July 21, 2006

[2/2] Calculation of Simple Interest for 3 sets of P, N, R (using For loop)

orkut.com
This program calculates the Simple Interest for 3 different values of P, N, R.
This program makes use of the For Loop, which is by far the most efficient loop used in C Programming.


#include<stdio.h>
main()
{

int p, n, count;
float r, si;

for (count=1;count<=3;count++)

{
printf ("Enter the values of p, n and r:");
scanf ("%d %d %f", &p, &n, &r);

si = p*n*r / 100 ;

printf ("Simple Interest = Rs. %f\n", si);
}

}



The file can be downloaded at:
Download File

No comments: