give an algorithm to find average value of three number
Answers
Answered by
1
This is in c++ :
#include<iostream.h>
#include<conio.h>
int main()
{
float num1, num2, num3,sum,avg;
cout<<"Enter the first number: ";
cin>> num1;
cout<<"Enter the second number: ";
cin>> num2;
cout<<"Enter the third number: ";
cin>> num3;
sum = num1+ num2+ num3;
avg = sum/3;
cout<<"The average of the numbers is <<avg<<"/n";
return(0);
getch();
}
Answered by
0
Explanation:
Following are the algorithm of the sum and the average of three numbers is given below.
Explanation:
Step 1: Start.
Step 2 :Read the three number suppose "a","b","c" form the user.
Step 3: Declared a variable "sum" and "Avg".
Step 4 : sum=a+b+c;
Step 5: Avg=sum/3.
Step 6:Display "sum " and "Avg".
Step 7 :End .
Similar questions