#include <iostream.h>
int main()
{
float number1, number2,
sum,average;
cout << "Enter two number: ";
cin >> number1;
cin >> number2;
sum = number1 + number2;
average = sum/2;
cout << "Sum =" << sum <<"\n";
cout << "Average =" << average <<"\n";
return 0;
}
Output:
Enter two numbers: 6.5 7.5
Sum = 14
Average = 7
0 comments:
Post a Comment