Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. main() {
  5.  
  6.     int x, y, z;
  7.    
  8.     printf("Digite o primeiro numero inteiro: ");
  9.     scanf("%d", &x);
  10.     printf("Digite o segundo numero inteiro: ");
  11.     scanf("%d", &y);
  12.     printf("Digite o terceiro numero inteiro: ");
  13.     scanf("%d", &z);
  14.      
  15.    
  16.     if(x >= y >= z) {
  17.         printf ("o maior numero eh %d", x);  
  18.     } else if(x >= z >= y) {
  19.         printf("o maior numero eh %d", x);
  20.     } else if(y >= x >=z) {
  21.         printf("o maior numero eh %d", y);
  22.     } else if(y >= z >= z) {
  23.         printf("o maior numero eh %d", y);
  24.     } else if(z >= x >= y) {
  25.         printf("o maior numero eh %d", z);
  26.     } else if( z >= y >= x) {
  27.         printf("o maior numero eh %d", z);
  28.     }
  29.                                            
  30.     printf("A media eh (%d + %d + %d)/3", x, y, z);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement