# Write a C Program to Find the Sum and Average of Three Numbers

In this article, we will see how to write a C program to find the sum and average of three numbers.

# Algorithm

Step 1: Start
Step 2: Declare variables num1, num2,num3, and sum, average.
Step 4: Add num1,num2, num3, and assign the result to the sum.
sum←num1+num2 +num3
average ← sum/3
Step 5: Display the sum and average
Step 6: Stop

# Flow Chart

+----------------+
|     Start      |
+----------------+
|
v
+---------------------------------------------------+
| Declare variables: num1, num2, num3, sum, average |
+---------------------------------------------------+
|
v
+------------------------------+
+------------------------------+
|
v
+---------------------------------------+
| sum ← num1 + num2 + num3              |
| average ← sum / 3                     |
+---------------------------------------+
|
v
+-------------------------------+
| Display the sum and average   |
+-------------------------------+
|
v
+----------------+
|     Stop       |
+----------------+

# C Program to Find the Sum and Average of Three Numbers

#include<stdio.h>
int main( )
{
int a,b,c;
int sum,average;
printf("Enter any three integers: ");
scanf("%d%d %d",&a,&b,&c);
sum = a+b+c;
average=sum/3;
printf("Sum and average of three integers: %d %d",sum,average);
return 0;
}

SAMPLE INPUT:

Enter any three integers:2 4 5

EXPECTED OUTPUT:

Sum and average of three integers: 11 3