Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6. void main()
  7. {
  8. double num1, num2, num3, num4, num5, num6;
  9.  
  10. printf("Enter the values of num1, num2 and num3\n");
  11. scanf("%lf %lf %lf", &num1, &num2, &num3);
  12. printf("num1 = %lf\tnum2 = %lf\tnum3 = %d\n", num1, num2, num3);
  13. if (num1 > num2)
  14. {
  15. if (num1 > num3)
  16. {
  17. printf("The value that was input for number 1 is the greatest among the three numbers \n");
  18. }
  19. else
  20. {
  21. printf("The value that was input for number 3 is the greatest among the three numbers\n");
  22. }
  23. }
  24. else if (num2 > num3)
  25. printf("The value that was input for number 2 is the greatest among the three numbers\n");
  26. else
  27. printf("The value that was input for number 3 is the greatest among the three numbers\n");
  28.  
  29. printf("Enter the values of number 4, 5 and 6\n");
  30. scanf("%lf %lf %lf", &num4, &num5, &num6);
  31. printf("num4 = %lf\tnum5 = %lf\tnum6 = %lf\n", num4, num5, num6);
  32. if (num4 < num5)
  33. {
  34. if (num4 < num6)
  35. {
  36. printf("The value that was input for number 4 is the least among the three numbers\n");
  37. }
  38. else
  39. {
  40. printf(" The value that was input for number 6 is the least among three \n");
  41. }
  42. }
  43. else if (num4 < num5)
  44. printf("The value that was input for number 4 is the least among the three numbers\n");
  45. else
  46. printf("The value that was input for number 5 is the least among the three numbers \n");
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement