Advertisement
Drowze

03 Comando Condicional de Selecao 07

Mar 29th, 2014
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. /* Fazer um programa que receba dois números e imprima o maior (pense na possibilidade
  2. dos números serem iguais). */
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6.  
  7. void main()
  8. {
  9.     int a,b;
  10.  
  11.     printf("Digite dois numeros e direi qual eh o maior: ");
  12.     scanf("%d", &a);
  13.     scanf("%d", &b);
  14.  
  15.     if(a>b) printf("Maior = %d\n",a);
  16.     else if(b>a) printf("maior = %d\n",b);
  17.     else printf("sao iguais\n");
  18.  
  19.     system("pause");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement