j

Monday, 2 November 2015

Write a program that take three number from user and display its sum and average



#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,sum;
float avg;
cout<<"Enter the number ::";
cin>>a>>b>>c;
sum=a+b+c;
avg=sum/3;
cout<<"Sum of the 3 numbers is "<<sum<<endl;
cout<<"Average of the 3 numbers is "<<avg<<endl;
getch();
}

Subscribe to this Blog via Email :