If I deciding a 3 random numbers and i want it gives only a middle number so, how can written this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If I deciding a 3 random numbers and i want it gives only a middle number so, how can written this code?

num1=10 num2=9 num3=5 And i want only 5

13th Aug 2020, 5:05 PM
Satyam Mishra
Satyam Mishra - avatar
10 Answers
+ 7
I am not sure what you mean by saying "middle number" . if you have 10,9,5 and you select 5 it is the number with the minimum value. Can you give us some more information about the criteria for choosing 5? thanks!
13th Aug 2020, 5:13 PM
Lothar
Lothar - avatar
+ 6
Satyam Mishra , i think te only way to help is, if you make us a real sample from input to output with all rules that have to be followed. Thanks!
16th Aug 2020, 9:30 AM
Lothar
Lothar - avatar
+ 2
Still not enough info.. How 5 comes from between 10, 9. You mean minimum of those 3? ??? min(n1,n2,n3)
13th Aug 2020, 5:27 PM
Jayakrishna 🇮🇳
+ 2
Hey Satyam Mishra According To Me Your Query Is Inappropriate Because Nobody Here Can Understand What You Wanna Explain.
13th Aug 2020, 5:37 PM
Rahul Saxena
Rahul Saxena - avatar
+ 2
I still have no idea what the ask is... https://code.sololearn.com/cIgmS3pxt9K7/?ref=app
14th Aug 2020, 8:54 PM
Steven M
Steven M - avatar
+ 2
Satyam why you are getting too confused... What do you want to do?? Do you want to print the smallest number or the number between greatest and smallest. (You can also use hindi or other preferable language)
16th Aug 2020, 11:17 AM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar
+ 1
I have 10,9,and 5 and i want give me a output between 10 and 9 i mean 5.
13th Aug 2020, 5:15 PM
Satyam Mishra
Satyam Mishra - avatar
+ 1
Sounds like min() to me, but middle number is median, both work. I would like to see an effort made, I think it will help everyone understand your ask too.
13th Aug 2020, 5:42 PM
Steven M
Steven M - avatar
+ 1
Satyam Mishra clear your question. I think you are facing translation problem.... you can also use hindi
14th Aug 2020, 1:21 PM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar
+ 1
My question is that- I want to giving 3 numbers.. And we want print number between greater and lesser but we arrange randomly.
14th Aug 2020, 8:35 PM
Satyam Mishra
Satyam Mishra - avatar