C examples for Array:Array Value
Declare an array to hold expenses, and a counter variable
#include <stdio.h> int main( void ) { float expenses[13]; //from w w w . j a va2s .co m int count; for (count = 1; count < 13; count++){ printf("Enter expenses for month %d: ", count); scanf("%f", &expenses[count]); } for (count = 1; count < 13; count++){ printf("Month %d = $%.2f\n", count, expenses[count]); } return 0; }