Asks user to specify five floating-point values, adds them, and then displays the result to the screen,

Asks user to specify five floating-point values, adds them, and then displays the result to the screen,

Input Screen
#include
using namespace std;
int main()
{
float a,b,c,d,e;
float sum;
//enter the floating values
cout << "Enter in floating values:\n"; cin >> a;
cin >> b;
cin >> c;
cin >> d;
cin >> e;
//add the floating values in sum
sum = a + b + c + d + e;
//the result will be shown in cout
cout << "Result is: "<

Output screen

Leave a Comment

Your email address will not be published. Required fields are marked *