TryThis0ne >> General >> Computers
help in C
Viewers: :
Quick reply
Reply
New Topic
 
Inj3ction




AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 102




Send Email Top
Sent on: 08/10/2005, 23:31:24 Reply | Quote | Warn | Edit
נפתר.

Edit by : Inj3ction At 09/12/2005, 18:20:11

K-Gen




AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 26




Send Email Top
Sent on: 08/10/2005, 23:36:20 Reply | Quote | Warn | Edit
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




AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 11




Send Email Top
Sent on: 12/10/2005, 10:14:15 Reply | Quote | Warn | Edit

#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




AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 102




Send Email Top
Sent on: 13/10/2005, 02:30:46 Reply | Quote | Warn | Edit
נפתר.

Edit by : Inj3ction At 09/12/2005, 18:20:32

All the times are GMT+2, ISRAEL
TryThis0ne >> General >> Computers

Quick reply
Reply
New Topic


Page generated using: 12 queries
Design by SBD © GeHeNoM.Net | Powered By Tera-Byte Forums 1.5 © JonJon & HLL
ý