Write a program that prints the numbers 1 to 4 on the same line with each pair of adjacent numbers separated by one space. Do this several ways:
a) Using one statement with one stream insertion operator.
b) Using one statement with four stream insertion operators.
c) Using four statements.
```
// Exercise 2.17 Solution: ex02_17.cpp
#include
using namespace std; // program uses names from the std namespace
int main()
{
// Part a
cout << "1 2 3 4\n";
// Part b
cout << "1 " << "2 " << "3 " << "4\n";
// Part c
cout << "1 ";
cout << "2 ";
cout << "3 ";
cout << "4" << endl;
} // end main
```
You might also like to view...
Write an algorithm that provides someone with clear directions on how to make your favorite snack.
What will be an ideal response?
The Brush tool alwayspaints with the ____ color.
A. background B. darkest C. lightest D. foreground
The migration of informatics and telehealth toward uHealth means:
- a sharp reduction in university programs for training healthcare providers to meet global patients needs - an approach toward underground installation of fiber optics and cable networks organized to meet global patients needs in a ubiquitous manner - conversion to a consumer-driven global healthcare model with localized implementation - ecosystems of interoperable technologies and services organized to meet global patients needs in a ubiquitous manner
What type of applications or programs might not work with Data Execution Prevention (DEP) enabled?
A. Programs that execute during the boot sequence that are not from Microsoft approved publishers. B. Programs that require real time processing. C. Programs that utilize multiple executable files. D. Programs that utilize dynamic code generation.