Program to input three number and calculate their Average.

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,m=0;
clrscr();
printf("Enter three number=");
scanf("%d%d%d",&a,&b,&c);
d=(a+b+c)/3;
printf("Average=%d",d);
getch();
}

OUTPUT 






Note:- If you want to calculate floating value (value which contains point) or fractional value ,you can use "float " and "%f" replace to "int " and "%d". If you want to calculate both use "double".

Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to input speed of Royal Enfield and check it's running at economic speed or not.