|
|
Inj3ction
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 102
|
|
|
|
|
|
|
|
× ×¤×ª×¨.
Edit by : Inj3ction At 09/12/2005, 18:20:11
|
|
|
|
|
|
K-Gen
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 26
|
|
|
|
|
|
|
|
You mean like:
double sum()
{
int i;
double s;
for(i=0;i<=13;i++){
s=s+expenses[i];
}
return s;
}
You can do this withoud declaring a new function ...
|
|
|
|
|
|
pro 1337
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 11
|
|
|
|
|
|
|
|
#include <stdio.h>
void main(void)
{
int count;
double expenses[13];
for(count=1;count<=12;count++)
{
printf("plz enter expenses for month %d\n", count);
scanf("%lf", &expenses[count]);
}
printf("month expenses\n");
printf("==========================================\n");
for(count=1;count<=9;count++)
{
printf(" %d %lf\n", count, expenses[count]);
}
for(count=10;count<=12;count++)
{
printf(" %d %lf\n", count, expenses[count]);
}
printf("==========================================\n");
}
|
|
|
|
|
|
|
Inj3ction
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 102
|
|
|
|
|
|
|
|
× ×¤×ª×¨.
Edit by : Inj3ction At 09/12/2005, 18:20:32
|
|
|
|
|