Write a program in c to display the simple interest
Write a program in c to display the simple interest table from 1st year to 10th year for the principle amount (p) Rs. 10,000/- and the rate of interest (r)2% p.a. with the formula si = p*n*r/100
Output
#include< #include< #include< main( ) { clrscr( ); int n; float p, r, si; p = 10000; r = 2; printf("\t Simple interest table\n"); printf("\n Year\t Interest(Rs.)\n"); for (n=1; n < =10; n++) { si = p*n*r/100; printf("%d\t%f\n", n, si); } return(0); } |
---|
Output
Simple Interest Table | |
---|---|
Year | Interest(Rs.) |
1 | 200.000000 |
2
|
400.000000 |
3
|
600.000000 |
4
|
800.000000 |
5
|
1000.000000 |
6
|
1200.000000 |
7
|
1400.000000 |
8
|
1600.000000 |
9
|
1800.000000 |
10
|
2000.000000 |
0 comments:
Post a Comment