Flowchart for finding biggest number in python

Flowchart for finding biggest number in python

  1. Develop a flowchart for finding biggest number among three numbers

Aim: To find biggest number between three numbers.

Algorithm:

  Step1: start

   Step2: Declare the variables a, b,c and read the inputs.

   Step3: If the condition a>b and a>c is true Print that a is largest.

   Step4: Otherwise go to the nextcondition b>c .If it is truePrint that b is largest, Otherwise      Print that c is largest,

   Step5: End

Source Code:

# we can find greater number in different way and in python there are different short- cut method to find the greater and smaller number among given number other wise you can take user input and then also you can. Sample code is given below

def greater_smaller(num1,num2):
if num1>num2:
return “num_1 is greater”
elif num2>num1:
return “num_2 is greater”
return “both are equal”
num1,num2=input(“enter your num1&num2 values:”).split(“,”)
print(greater_smaller(num1,num2))

Flowchart:

Flowchart for finding biggest number in python

Input:

enter a value : 10

enter b value : 25

enter c value : 12

Output:

b is largest —-Run complete.  8 symbols evaluated.—-

 

b) Implement Python script to find biggest number between two numbers.

Aim: To find biggest number between two numbers
Algorithm:
Step1: Start
Step2; Declare the variables a & b and read a,b.
Step3: check condition a>b
Step4: If the condition is true Print that a is largest
Step5: Otherwise Print that b is largest
Step6: End

Program:
a=int(input(“enter a:”))
b=int(input(“enter b:”))
if (a>b):
print(“a is largest”)
if (a<b):
print(“b is largest”)
else:
print(“a and b are equal”)
Output:
>>>
enter a:15
enter b:23
b is largest
>>>

Related Link:

Flowchart for finding biggest number in python

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

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

Leave a Comment

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