WAP to input three numbers and print the average of the largest two numbers
Answers
Answered by
2
Answer:
printf ( "%d is the largest number." , B); if (C >= A && C >= B) Output: Enter the numbers A, B and C: 2 8 1 8 is the largest number.
Explanation:
Hope it helps you dear friend
Answered by
3
nums = [int(n) for n in input("enter 3 nums: ").split()]
sorted_nums = sorted(nums)
sorted_nums_sum = sorted_nums[-1] + sorted_nums[-2]
print(f"average is: {sorted_nums_sum / 2}")
Similar questions
Accountancy,
2 months ago
English,
2 months ago
Math,
5 months ago
Math,
11 months ago
English,
11 months ago