Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3.  
  4. main(){
  5. clrscr();
  6. int x1,x2,x3,y,w,z;
  7. cout<<"\t\nPrograma que muestra el mayor de 3 numeros";
  8. cout<<"\n\nIngresa tres valores:\n";
  9. cin>>x1;
  10. cin>>x2;
  11. cin>>x3;
  12. y= ((x1>x2)&&(x1>x3)) + (1+(x2>x1)&&(x2>x3)) + (2+(x3>x1)&&(x3>x2));
  13. switch(y,w,z)
  14. {
  15. case 1:
  16. cout<<"\nEl mayor de los numeros es "<<x1;
  17. break;
  18. case 2:
  19. cout<<"\nEl mayor de los numeros es "<<x2;
  20. break;
  21. case 3:
  22. cout<<"\nEl mayor de los numeros es "<<x3;
  23. break;
  24. default:
  25. cout<<"\nLos valores ingresados son iguales.";
  26. }
  27. getch();
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement