Instructions
Consider the following program segment:
//includestatement(s)
//usingnamespacestatement
intmain()
{
//variabledeclaration
//executablestatements
//returnstatement
}
Write a C++ statement that includes the header fileiostream.
Proceed through all the steps in this activity by clicking the navigation arrows at the bottom of this pane after completing each step.
Instructions
Consider the following program segment:
//includestatement(s)
//usingnamespacestatement
intmain()
{
//variabledeclaration
//executablestatements
//returnstatement
}
Write a C++ statement that includes the header fileiostream.
Proceed through all the steps in this activity by clicking the navigation arrows at the bottom of this pane after completing each step.
Instructions
Write a C++ statement that allows you to usecin
,cout
, andendl
without the prefixstd::
.
Write C++ statement(s) that declare the following variables:num1
,num2
,num3
, andaverage
of typeint
.
Write C++ statements that store125intonum1
,28intonum2
, and–25intonum3
.
Write a C++ statement that stores the average ofnum1
,num2
, andnum3
intoaverage
.
Final Step:
Write C++ statement(s) that output the values ofnum1
,num2
,num3
, andaverage
.
Then compile and run your program by clicking the blue run button on the right side of the screen.