Challenge for everyone!

I have this finals lab exam wherein it became a take home exam for no freshmen understand and get the codes. We need to make a program that print out the highest value and the lowest value in an input array using functions. I really need your help. Thanks
closed account (48T7M4Gy)
Is this just a general inquiry or do you intend showing us what you've done so far?
I haven't done anything so far cause I don't have any idea. My prof didn't taught us about this but she gave it as an assignment. So i guess this is a general inquiry. I tried searching and done this one on our exam that became a take home. My prof told me that it is correct but we need to define first. Here's my code:

int num[5]
int x;
int y;

int max(int num1){
for (int z=0;z<5;z++){
y=num[z];
}
}
return y;

int main(){
cout<<"Type Integers:"<<endl;
for(x=0;x<5;x++)
{
cin>>num[x]
}
cout<<"The Highest Integer is:"<<max(y)<<endl;
return 0;
}

I only done the highest value. Here's the problem:
Create a program that holds an array containing 5 integers. Create two methods that accept the array. The first method named lowest returns the lowest from the 5 numbers while the second method returns the highest number from the list. Determine the highest and lowest numbers without sorting the numbers. Your output should contain the original list of number, the highest and the lowest number from the list. Supply the necessary values for the array.
Thanks for your time reading this.
Do not double post. You are wasting people's time.

http://www.cplusplus.com/forum/beginner/176393/
Last edited on
Oh Sorry!
Topic archived. No new replies allowed.