Advertisements
Advertisements
प्रश्न
Write an algorithm that accepts four numbers as input and finds the largest and smallest of them.
टीपा लिहा
Advertisements
उत्तर
Input first number
Input second number
Input third number
Input fourth number
Set lst = [ first , second, third , fourth ]
Sort the lst
lst.sort( )
Print greatest number is lst [ -1 ]
Print smallest number is lst [ 0 ]shaalaa.com
Representation of Algorithms
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
