Page 1 of 1

Retrive max,min & avg values from file

PostPosted: Mon Feb 07, 2011 12:03 am
by 9949125444
HOW WE CAN GET THE MAXIMUM SALARY AND MINIMUM SALARY AND AVERAGE SALARY BY USING SEQUENTIAL FILE IT CONTAINS SALARY DETAILS....?
PLEASE ANY BODY CAN HELP ME OVER IT!!!

Re: Retrive max,min & avg values from file

PostPosted: Mon Feb 07, 2011 12:23 am
by dick scherrer
Hello and welcome to the forum,

TURN OFF THE CAPS. . . That is just rude. . .

From the little you've posted, suggest you read the file and store the maximum and minimum salary values as they are discovered. While discovering the min and max, sum all of the salary values read and count the records read. When end of file is reached show the min and max, divide the total salary by the number of records to get the average and show that value.

Re: Retrive max,min & avg values from file

PostPosted: Mon Feb 07, 2011 10:33 am
by 9949125444
Thanks for the reply and sorry mistake will not repeat again