home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
expenses.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
588b
|
27 lines
/* EXPENSES.C--Demonstrates use of an array */
#include <stdio.h>
/* Declare an array to hold expenses, and a counter variable */
float expenses[13];
int count;
main()
{
/* Input data from keyboard into array */
for (count = 1; count < 13; count++)
{
printf("Enter expenses for month %d: ", count);
scanf("%f", &expenses[count]);
}
/* Print array contents */
for (count = 1; count < 13; count++)
{
printf("\nMonth %d = $%.2f", count, expenses[count]);
}
}