Flowchart to find largest element in an array in python


Flowchart to find largest element in an array in python

Develop a flowchart to find largest element in an array. In this we have to find largest element which is entered by the user. we will also see max and min difference and max and min using def.

Aim:

To  draw the flowchart for finding largest element in the array.

Algorithm of flowchart to find largest element in array

Step-1 : Start

Step-2: Enter the array size and read as n.

Step-3: Enter the array elements and read as a[i].

Step-4: Initialize to i and a[i] to large.

Step-5: In i loop check the condition i>n-1.

Step-6: check the condition a[i+1]>large

Step-7: If the condition is true then assign a[i+1] to large, otherwise go to next iteration.

Step-8: Print the largest element

Step- 9: End

Diagram of flowchart to find largest element

Flowchart to find largest element in an array in python
Flowchart to find largest element in an array

Source Code:

Find max and min

num1=[163,45,28,85,214,101]
print(“Minimum value is:”,min(num1))
print(“Maximum value is:”,max(num1))
# ………………………

find max and min difference

def max_Min_diff(num):
return max(num) – min(num)
num1=[163,45,28,85,214,101]
print(“The difference of max and min is:”,max_Min_diff(num1))
# ………………………………………………………..

Max and Min using def

def max_min(num):
return “maximum:->”,max(num),”minimum:-> “,min(num)
num1=[163,45,28,85,214,101]
print(max_min(num1))

Related Link:

Flowchart to find Minimum and Maximum Numbers in an Array

https://www.programming9.com/raptor-flowcharts/333-flowchart-to-find-minimum-and-maximum-numbers-in-an-array

https://en.wikipedia.org/wiki/Sorting_number

https://en.wikipedia.org/wiki/Sorting

https://en.wikipedia.org/wiki/Integer_sorting

https://www.geeksforgeeks.org/c-program-find-largest-element-array/

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories