Write an algorithm to find the average of two numbers in computer science
Answers
Answered by
7
Explanation:
Flowchart and algorithm
Write an algorithm for finding the average of two numbers and also draw a flowchart.
Algorithm: Input: two numbers x and y Output: the average of x and y Step 1 : input x,y Step 2: sum=0,average=0 Step 3:sum = x + y Step 4:average = sum /2 Step 5: print average.
Similar questions