Home About Contact Privacy Terms Disclaimer
TECHAntena
Last Updated On: May 8, 2017
Editor: Adeeb C

C Program to Print Sum & Average of Three Numbers

Category: C,Programing
Tags

Aim: Write a program to print sum and average of three numbers.

Program Code:

#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,c,sum,avg;
 clrscr();
 scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
sum=a+b+c;
avg=sum/3;
printf("Sum = %d, Avg = %d",sum,avg);
getch();
}

 

Output:

4
6
8
Sum = 18
Avg = 6