In: Computer Science
pseudocode The main( ) program passes these integer values as arguments to the findMax( ) method for further processing. The main program receives one result back from findMax( ) method and displays the maximum of these three integer values. The findMax( ) method simply receives three integer values from the main program and finds the maximum of three integers and returns one value back to the caller (in this case the main application).
here is the answer..
CODE:
#include<stdio.h>
int findMax(int a,int b,int c)
{
if(a>b && a>c)
return a;
else if(b>c)
return b;
else
return c;
}
int main()
{
int a,b,c;
printf("ENter 3 number :");
scanf("%d%d%d",&a,&b,&c);
printf("Max : %d",findMax(a,b,c));
}
OUTPUT:
PSUEDOCODE:
-> Read 3 numbers
-> call finMax() with 3 numbers
-> check if first number greater than other two numbers
->return first number
-> check second number greater than third
-> return second number
->return third number.
If you have any doubts please COMMENT...
If you understand the answer please give THUMBS UP.....