Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- void main()
- {
- double num1, num2, num3, num4, num5, num6;
- printf("Enter the values of num1, num2 and num3\n");
- scanf("%lf %lf %lf", &num1, &num2, &num3);
- printf("num1 = %lf\tnum2 = %lf\tnum3 = %d\n", num1, num2, num3);
- if (num1 > num2)
- {
- if (num1 > num3)
- {
- printf("The value that was input for number 1 is the greatest among the three numbers \n");
- }
- else
- {
- printf("The value that was input for number 3 is the greatest among the three numbers\n");
- }
- }
- else if (num2 > num3)
- printf("The value that was input for number 2 is the greatest among the three numbers\n");
- else
- printf("The value that was input for number 3 is the greatest among the three numbers\n");
- printf("Enter the values of number 4, 5 and 6\n");
- scanf("%lf %lf %lf", &num4, &num5, &num6);
- printf("num4 = %lf\tnum5 = %lf\tnum6 = %lf\n", num4, num5, num6);
- if (num4 < num5)
- {
- if (num4 < num6)
- {
- printf("The value that was input for number 4 is the least among the three numbers\n");
- }
- else
- {
- printf(" The value that was input for number 6 is the least among three \n");
- }
- }
- else if (num4 < num5)
- printf("The value that was input for number 4 is the least among the three numbers\n");
- else
- printf("The value that was input for number 5 is the least among the three numbers \n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement