1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
yulyashka [42]
3 years ago
5

Write a program that prints the numbers 1 to 4 on the sameline with each pair of adjacent numbers separated by a single space(1

2 3 4). Print the numbers in the followingthree ways:
(a) Using one output statement with one streaminsertion operator.
(b) Using one output statement with four streaminsertion operators.
(c) Using four output statements.
Computers and Technology
1 answer:
kondaur [170]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

int main() {

   cout<<"Printing by method 1"<<endl;

   //using 1 output statement with one streaminsertion operator.

   cout<<"1 2 3 4";

   cout<<endl<<"Printing by method 2"<<endl;

   //using 1 output statement with four stream insertion operator.

   cout<<"1 "<<"2 "<<"3 "<<"4";

   cout<<endl<<"Printing by method 3"<<endl;

   //using four output statements.

   cout<<"1 ";

   cout<<"2 ";

   cout<<"3 ";

   cout<<"4 ";

return 0;

}

Output:-

Printing by method 1

1 2 3 4

Printing by method 2

1 2 3 4

Printing by method 3

1 2 3 4

Explanation:

The above code is as per the question given.All the three methods are implemented as per the question.

You might be interested in
A graphic design student is putting the finishing touches on her PowerPoint presentation for her speech. She is carefully analyz
elixir [45]

Answer:

Balance

Explanation:

Maintaining balance entails making sure things are in the right place, in the right proportion and maintaining a stable look and stand.

Maintaining a balance on a power point presentation entails that one considers these; ths one should carefully analyse how the different images go together and ensure that the positioning of elements within the images helps to make the individuals point and is pleasing to view.

This can be tasking but worth every effort put in to achieve such, because it will make your presentation to be easier to explain and better understood.

7 0
3 years ago
How does electricity work in phones?
kati45 [8]
Great Question! So the plug will go into the wall and electricity will hit the cord and power through the cord into the charger (Cordless) Now if you talking mobile phones such as iPhones. The battery powers wire and hardware to power your little mobile phone! Hope this helps.
8 0
3 years ago
Whats my screen name?
adoni [48]
It could be any thing of your chose
8 0
3 years ago
Read 2 more answers
In order for a sort to work, which of the following is required?
nydimaria [60]
Can u plz give me a picture
3 0
2 years ago
Type the correct answer in the box. Spell all words correctly. Complete the sentence based on the role education plays to help y
CaHeK987 [17]

Answer:

what do i do??

Explanation:

8 0
3 years ago
Other questions:
  • Identify the function for the following computer part: Printer Question 23 options: Input
    6·1 answer
  • What port does rdp use by default and from what range of numbers should you select a private port number?
    15·1 answer
  • What tool is included with windows 8 that will help you connect to the directaccess server when you have problems and can be use
    6·1 answer
  • Which element of presentation software can you use to add callouts and banners?
    5·2 answers
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • What does this result prove about the computer’s network connectivity?
    12·1 answer
  • Basics AutoCare is a small auto service business with two locations in a Midwest (U.S.) city. The business is based on providing
    13·1 answer
  • Using ________ as a promotion method will bring return visitors to your site.
    8·1 answer
  • 5.During a recent network attack, a hacker used rainbow tables to guess network passwords. Which type of attack occurred
    9·1 answer
  • Which term describes a visual object such as a picture a table or text box
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!