Computer Science, asked by taimoorali12, 1 year ago

Take five numbers as input from the user using only 1 variable, calculate and display their sum, average and sum of even numbers. (without using loop)

write algorithm​

Answers

Answered by sailorking
0

Answer:

The algorithm to calculate sum, average and sum of even numbers is as follow:-

  1. Step-> Start
  2. Step-> Declare five integer variables (a,b,c,d,e) type integer.
  3. Step-> Take input of five numbers.
  4. Step-> Add all variables and print the sum. Print (a+b+c+d+e)
  5. Step-> Calculate the average and print the result. Print ((a+b+c+d+e)/5)
  6. Step->  Check the number is even or odd, if even calculate the sum in another variable, and print the result.
  7. Step-> Stop

Explanation:

Here in the algorithm there are total three calculations, the longest calculation  is done in the calculation of the sum of digits.

Similar questions