Question: -Write a C++ statement that includes the header file iostream. -Write a C++ statement that allows you to use cin, cout, and endl without the
-Write a C++ statement that includes the header file iostream.
-Write a C++ statement that allows you to use cin, cout, and endl without the prefix std::.
-Write C++ statement(s) that declare the following variables: num1, num2,num3, and average of type double.
-Write C++ statements that store 75.35 into num1, 35.56 into num2, and 15.76 into num3
-Write a C++ statement that stores the average of num1, num2, and num3 into average
-Final Step:
Write C++ statement(s) that output the values of num1, num2, num3, and average.
Then compile and run your program!
my code so far : helppp xd
#include
using namespace std;
int main()
{
int double num1, num2, num3;
num1 = 75.35;
num2 = -35.56;
num3 = 15.76;
int double average = (num1 + num2 + num3) / 3;
cout << "Num 1 = " << num1 << endl;
cout << "Num 2 = " << num2 << endl;
cout << "Num 3 = " << num3 << endl;
cout << "Average = " << average << endl;
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
