C++ Program

Program Average of the two Numbers

#include <iostream.h> 
#include<conio.h> 
void main()
{
 double x, y; 
 clrscr(); 
 cout << "Enter Two Floating Values: "; 
 cin >> x ; 
 cin >> y; 
 cout << "The Average of the two Numbers is : " << (x+y)/2.0 << endl; 
 getch(); 
}

Output

Enter Two Floating Values: 20
30
The Average of the two Numbers is : 25







You may also like: