0

May i know how to write this program.
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


should the code be like this:

int maximum (int x, inty){int z;z=(x>=y)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);
please help.me thanks!

3
Contributors
6
Replies
7
Views
11 Years
Discussion Span
Last Post by Ancient Dragon
0

sorry! here it is

int maximum (int x, inty)
{
int z;
z=(x>=y)
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);
}

0

well, that's a little better. You still did not use code tags (see Andor's post for a link on how to do that).

More importantly, what is the question? Did you attempt to compile that code? what error(s) did your compiler produce?

0

Hi,

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


my question is what does it mean by array & it size? what should i input?

0

that is not a question -- it is your assignment. you already have a function that returns the larger of two values. So just write a function called bigger that returns the largest value in an array.

int bigger(int array[], int arraySize)
{
   // put your code here

}
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.