Science, asked by sanketvairagade9, 1 month ago

Question No. 33
• Suppose you want to write a
procedure that takes three
numbers, num1, num2, and
num3; and returns their sum,
product, and average. Which is
the best option?
Answer​

Answers

Answered by rudraksh791
1
Question No. 33
• Suppose you want to write a
procedure that takes three
numbers, num1, num2, and
num3; and returns their sum,
product, and average. Which is
the best option?
Answer
Answered by Jasleen0599
0

Algorithm:

  1. Start
  2. Input 3 numbers say num1, num2, num3.
  3. Output 3 numbers say sum, product, avg.
  4. sum = num1 + num2 + num3
  5. product = num1 * num2 * num3
  6. avg = sum / 3
  7. Display sum
  8. Display product
  9. Display avg
  10. End

Pseudo c o d e:

int num1, num2, num3, sum, product ;

float avg;

sum = num1 + num2 + num3 ;

product = num1 * num2 * num3 ;

avg = sum / 3 ;

printf ("%d \n %d \n %f", sum, product, avg);

Similar questions