Computer Science, asked by preethi148838, 3 months ago

accept any three number and print the smallest number​

Answers

Answered by life0501
1

Explanation:

Input: first = 15, second = 16, third = 10

Output: 10

Input: first = 5, second = 3, third = 6

Output: 3

Recommended: Please try your approach on {IDE} first, before moving on to the solution.

Approach:

Check if the first element is smaller than second and third. If yes then print it.

Else if check if the second element is smaller than first and third. If yes then print it.

Else third is the smallest element and print it.

Below is the implementation of the above approach:

Similar questions