nikolas_serafini

Lista 1 - Exercício 44

May 24th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main()
  6. {
  7.     float a,b,c,bigger1,bigger2;
  8.  
  9.     printf("Insira tres numeros reais : \n"); scanf("%f %f %f",&a,&b,&c);
  10.  
  11.     bigger1 = (a + b + abs(a-b))/2;
  12.     bigger2 = (bigger1 + c + abs(bigger1 - c))/2;
  13.  
  14.     printf("O maior numero inserido foi : %f\n",bigger2);
  15.     return 0;
  16. }
  17.  
  18. //OBS: O exercício não permitia o uso de condicionais.
Advertisement
Add Comment
Please, Sign In to add comment