Advertisement
ThaisAlmeida

Lista funções questão 7

Jun 17th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1.  
  2.     int MaiorNumero(int a,int b);
  3.     {
  4.      int maior;
  5.      if(a>b)
  6.      {
  7.       maior = a;
  8.      }
  9.      else
  10.      {
  11.       maior = b;
  12.      }
  13.      return maior;
  14.     }
  15.      
  16.     int main()
  17.     {
  18.     int a,b,i,resultado;
  19.     i=0;
  20.     do
  21.     {
  22.             printf("Digite dois valores: ");
  23.             scanf("%d%d", &a, &b);
  24.             if(a=b)
  25.             {
  26.                 printf("Eles são iguais!");
  27.             }
  28.             else
  29.             {
  30.             resultado = MaiorNumero(a,b);
  31.             printf("O maior valor eh: %d", resultado);
  32.             i++;
  33.             }
  34.     } while(i<=5);
  35.     return 0;
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement