Write algorithm for problem that allow the user to input three numbers and display the sum,the average and the product
Answers
Answer:
#include<stdio.h>
int main ()
{
int a;
int b;
int c;
int d;
int e;
int f;
printf ("Enter the first number:");
scanf ("%d", &a);
printf ("Enter the second number:");
scanf ("%d", &b);
printf ("Enter the third number:");
scanf ("%d", &c);
d = a + b + c;
printf ("The sum of the three numbers:%d",d\n);
e = d/3;
printf ("The average of the three numbers:%d",e\n);
f = a*b*c;
printf ("The product of the three numbers:%d",f\n);
}
Explanation:
This is the solved algorithm for problem that allow the user to input three numbers and display the sum,the average and the product. Here, we are using the C programming language to solve this algorithm. Here, we are using #include<stdio.h> which stands for standard input output. Here, we are using newline command \n to print the first result after next line it prints the second result and then it prints the third result after next line. Here, we are using printf() function to print the results and other requests. Here, scanf() function is used to scan or take input from the user. Here, %d is the specifiers of the integer. All these functions of C programming language printf() and scanf() which come under the library of #include<stdio.h>.
Learn more from this link:
https://brainly.in/question/2090424