#include #include int guarda_maior(valor, maior) float valor; /* Parametro: by value / por valor */ float *maior; /* Parametro: by ref / por referencia (altera variavel) */ { if (valor > *maior) { *maior = valor; return (1); /* Trocou valor do maior */ } else return (0); /* Nao trocou */ } main() { int retorno; float a,b; a=10.0; b=5.0; printf("A = %.2f # B = %.2f\n",a,b); retorno=guarda_maior(a,&b); if (retorno) printf("Trocou o maior\n"); else printf("Nao trocou o maior\n"); printf("A = %.2f # B = %.2f\n",a,b); printf("\n\n"); system("pause"); }