fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. // variable declaration
  6. int v = 5, w = 10, x = 15, y = 20, z = 25, max;
  7.  
  8. // Largest among n1, n2, n3 and n4
  9. max = (v > w && v > x && v > y && v > z) ?
  10. v :
  11. (w > x && w > y && w > z) ?
  12. w :
  13. (x > y && x > z) ?
  14. y :
  15. (y > z ? y : z);
  16.  
  17. // Print the largest number
  18. printf("Largest number among %d, %d, %d, %d, %d is %d.",
  19. v, w, x, y, z, max);
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 4548KB
stdin
Standard input is empty
stdout
Largest number among 5, 10, 15, 20, 25 is 25.