Computer Science, asked by jaydhote099, 3 months ago

write a algorithm to find the smallest and largest number using arrays​

Answers

Answered by bodasaijaladhija1
0

Answer:

Input the array elements.

Initialize small = large = arr[0]

Repeat from i = 2 to n.

if(arr[i] > large)

large = arr[i]

if(arr[i] < small)

small = arr[i]

Print small and large.

Answered by kamala250306
0

Answer:

  1. Input the array elements.
  2. Initialize small = large = arr[0]
  3. Repeat from i = 2 to n.
  4. if(arr[i] > large)
  5. large = arr[i]
  6. if(arr[i] < small)
  7. small = arr[i]
  8. Print small and large.

Explanation:

HOPE IT'S HELPS

MARK ME AS A BRAIN LIST

Similar questions