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!

Recommended Answers

All 6 Replies

Beatuify all your posts by code tags

Shermaine: you need to edit your post and reformat that code to make it readable -- I'm not going to read that crap!

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

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?

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?

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

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