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
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
• 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
0
Algorithm:
- Start
- Input 3 numbers say num1, num2, num3.
- Output 3 numbers say sum, product, avg.
- sum = num1 + num2 + num3
- product = num1 * num2 * num3
- avg = sum / 3
- Display sum
- Display product
- Display avg
- 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