The question is :Write a function bigger() that returns bigger vaule in a signed integer array. Array and size are passed as arugements.
Write a main program that inputs Max values from the keyboard into siged integer array,array and prints using biggest(), the biggest vaule to the screen
What should i amend for this? Please advise. Thanks!

# include <stdio.h>
int maximum (int array[], int array Size)
{
int z;
int x;
z=(int array[]>=int array Size)
return(x);
}
main()
{
int a,b,c,d;
printf("%na=");
scanf("%d",&a);
printf("\nb=");
scanf("%d",&b);
printf("\nc=");
scanf("%d",&c);
printf("\nd=");
scanf("%d",&d);
d=maximum(c,b);
printf("\n\maximum = %d",maximum(c,d);
}

Recommended Answers

All 2 Replies

You need to declare an array. For example int array[MAX_ELEM] . You must define MEX_ELEM (look on google whats macroes in C if U don't know). In a loop you must enter their elements. To pass the array size you can do like this sizeof(array)/sizeof(int) In bigger function you need to loop throught an array and find out the max value, for example

int max =0;
// for loop goes here
if (array[i] > max)
   max = array[i];
//end foor loop
return max;

PS: Don't post the same question twice ;)

PS: Don't post the same question twice ;)

And please start using code tags, and posting with titles that have some meaning -- like a short description of what the program is about.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.