[Dev-C++] How to add the total.......
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: LETCHUMANAN S. <arl...@ya...> - 2005-04-15 01:48:25
|
Dear all,
I'm having a problem in in adding the total amount, my program as below...
if((col=fopen("total utility.doc","r"))==NULL)
printf("Cannot open file!");
else
{
while(!feof(col))
{
fscanf(col,"%f\n",&data.utl);
printf("%.2f\n",data.utl);
}
}
fflush(stdin);
printf("Press ENTER to continue....");
getchar();
fflush(stdin);
fclose(col);
The output:- 6.25
12.50
13.80
I want the total to be displayed as, 32.55. There is a way to get it, can someone please help me on this program...
Thanks to all,
Letchu...
Yahoo! Mobile
- Download the latest ringtones, games, and more! |