Advertisement
emmit

maior valor de entre numeros

Aug 4th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Elabora um algorítimo que leia 3 valores e diga qual maior*/
  2.  
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. int main(){
  7.  
  8.     int num;
  9.     int i, maior;
  10.    
  11.     for(i=0; i<3; i++){
  12.  
  13.         scanf("%i", &num);
  14.         if(num >= maior){
  15.  
  16.             maior=num;
  17.  
  18.         }
  19.  
  20.     }
  21.  
  22.     printf("%d", maior);
  23.    
  24.     return 0;
  25.     getch();
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement