Guys, Im in desperately need of help, and I need the whole program to be written, as I dont understand anythuing in pascal haha.
Thanks for any help, I really appreciate it!
By the way, this is also my first post here, yay
Is this the whole program? I put it in and it didnt seem to work, when I typed a number it just minimized.
Sorry, but im really stupid in Pascal lol
Of course this is the whole program.
Contains an array and two functions's calling.
And it is working
I wrote my program in dev pascal 1.9.2.It is a free pascal compiler,support (almost) every commands of the Turbo Pascal 7.0,and 100% free pascal compatible and it is free....
Last edited by FlamingClaw; Aug 2nd, 2009 at 4:20 am.
I wonder, High and Low return the highest and lowest array index iirc. Isn't he looking for Min and Max ?
If you try my code (just copy and paste) ,you will see the results low as 0 and high as 124,the type of byte's range is 0..255
But he want to know the max range of byte type then
Re: How do I get the highest and lowest of an array?
So we can help a little better, could clarify what you need a little?
Do you need the highest and lowest VALUE in the array? What type of array are you using (integer, float, etc)? How should the program receive the array?
If you decide to take a whack at it yourself (and you're looking for min max values), you'll basically want to have a program that starts with two variables "MIN" and "MAX". Set them both to the first value in your array. Then loop through the array, comparing each number to min and max. If a number is less than the value in MIN, set MIN to that number. If a number is greater than MAX, set MAX to that number.
writeln('Enter the total number of inputs. Then, enter them one by one until you see an output.');
readln(control);
sum := -1000000;
for i := 1to control do
begin
readln(input);
if input >= sumthen
begin
sum := input;
end;
end;
writeln(sum:0:4);
readln;
end.
I also have a program that find the minimum of the given input. But, I'll leave that and the array part for you to work out. After all, I shouldn't have to all the work.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.