orlandoju

Ejer9_tp2

Mar 31st, 2022
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main(void){
  6.  
  7. int num1,num2,num3;
  8.  
  9. cout<< "Ingrese el primer numero: " ;
  10. cin>> num1;
  11. cout<< "Ingrese el segundo numero: " ;
  12. cin>> num2;
  13. cout<< "Ingrese el tercer numero: " ;
  14. cin>> num3;
  15.  
  16. if(num1>num2 && num1>num3){
  17. cout<< "El mayor numero es: "<<num1;
  18. }
  19. else{
  20. if(num2>num1 && num2>num3){
  21. cout<<"El mayor numero es: "<<num2;
  22. }
  23. else{
  24. if(num3>num1 && num3>num2){
  25. cout<<"El mayor numero es: "<<num3;
  26. }
  27. }
  28. }
  29.  
  30. return 0;
  31. }
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment