0

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);
}

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by WaltP
0

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 ;)

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.