Monday, April 9, 2012

Calculate Average of Four Numbers in C++


/*************<soeasyprograms.blogspot.in>*****************/

//Write a Program to calculate average of four numbers
#include <iostream.h>
#include <conio.h>
void main ()
{
int a,b,c,d,avg;
clrscr ();
cout <<"Enter 5 Numbers";
cin >>a >>b >>c >>d;
avg =(a+b+c+d)/4;
cout <<"\n Average is: "<<avg;
getch ();
}
Output of this Program is:



No comments:

Post a Comment