fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. float n1;
  7. float n2;
  8. float n3;
  9.  
  10. cout<<"Please enter the three (3) numbers:/n";
  11. cout<<"Enter the First number";
  12. cin>>n1;
  13. cout<<"Enter the Second number";
  14. cin>>n2;
  15. cout<<"Enter the Third number";
  16. cin>>n3;
  17.  
  18. if (n1>n2&&n1>n3)
  19. {
  20. cout<<"The largest number is - "<<n1;
  21. }
  22. else
  23. {
  24. if (n2>n1&&n2>n3)
  25. {
  26. cout<<"The largest number is - "<<n2;
  27. }
  28. else
  29. {
  30. if (n3>n1&&n3>n2)
  31. {
  32. cout<<"The largest number is - "<<n3;
  33. }
  34. else
  35. {
  36. cout<<"They are equal";
  37. }
  38. }
  39. }
  40.  
  41. return 0;
  42. }
Success #stdin #stdout 0s 3432KB
stdin
5
15
10
stdout
Please enter the three (3) numbers:/nEnter the First numberEnter the Second numberEnter the Third numberThe largest number is - 15