Skip to content

Instantly share code, notes, and snippets.

@tuxcuiabano
Last active September 24, 2016 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuxcuiabano/49817df4ec3c5076104a3d4cf57d8e09 to your computer and use it in GitHub Desktop.
Save tuxcuiabano/49817df4ec3c5076104a3d4cf57d8e09 to your computer and use it in GitHub Desktop.
Função Máximo
#include <stdio.h>
int maximo (int x,int y, int z);
int main()
{
// printf("Hello, World!\n");
int num1,num2,num3;
printf("Digite 3 numeros\n");
scanf("%d%d%d",&num1,&num2,&num3);
printf("O maior: %d\n",maximo(num1,num2,num3));
return 0;
}
int maximo (int x,int y, int z){
int max =x;
if(y>max){
max=y;
}
if(z>max){
max=z;
}
return max;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment