Answer:
Following are the code in the C language .
int max(int x) // function definition
{
static int largest=0; // variable declaration
if (x>largest) // checking the condition
largest=x; // assign the value of input in the largest variable
return largest; // return the largest number
}
Step-by-step explanation:
Following are the description of code .
- Decalred a function max of int type which hold a parameter x of int datatype.
- In this function compared the number x with the largest .If this condition is true then largest number hold the value of x variable
- Finally return the largest number .