Monday, December 10, 2007

How to input data into an array

How to input data into an array

To input data into an array

#include

float fees[5];

int times;

main()

{ for (times = 1; times <>

{ printf("Enter expenses for month %d: ", times);

scanf("%f", &fees[times]);}

for (times = 1; times <>

{ printf("Month %d = $%.2f\n", times, fees[times]);}

return 0; }

Result :


No comments: