- Aug 30, 2004
- 2,519
- 1
- 81
Code:
#include <stdio.h>
float la, pay;
int main(void)
{
printf("Enter loan amount: ");
scanf ("%f", &la);
printf("Enter payment: ");
scanf ("%f", &pay);
printf("%.2f\n%.2f\n", la, pay);
int i=0;
while (la>0 )
{ la=la-pay;
printf("%.2f\n", la);
i--;
}
return 0;
}
Enter loan amount: 20000
Enter payment: 200
20000.00
200.00
19800.00
19600.00
19400.00
19200.00
19000.00
18800.00
18600.00
18400.00
18200.00
18000.00
17800.00
17600.00
17400.00
17200.00
17000.00
16800.00
16600.00
16400.00
16200.00
16000.00
15800.00
15600.00
15400.00
15200.00
15000.00
14800.00
14600.00
14400.00
14200.00
14000.00
13800.00
13600.00
13400.00
13200.00
13000.00
12800.00
12600.00
12400.00
12200.00
12000.00
11800.00
11600.00
11400.00
11200.00
11000.00
10800.00
10600.00
10400.00
10200.00
10000.00
9800.00
9600.00
9400.00
9200.00
9000.00
8800.00
8600.00
8400.00
8200.00
8000.00
7800.00
7600.00
7400.00
7200.00
7000.00
6800.00
6600.00
6400.00
6200.00
6000.00
5800.00
5600.00
5400.00
5200.00
5000.00
4800.00
4600.00
4400.00
4200.00
4000.00
3800.00
3600.00
3400.00
3200.00
3000.00
2800.00
2600.00
2400.00
2200.00
2000.00
1800.00
1600.00
1400.00
1200.00
1000.00
800.00
600.00
400.00
200.00
0.00
it does this
Would somebody show me how nto order it into columns or rows of 12.
Thanks
ps I'm trying to teach myself C and it isn't easy.
Last edited: