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]
2 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]2 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
If we want to access files located in a directory on a remote server, which of these options would we use?
Ray Of Light [21]
DNS obviously...............
5 0
2 years ago
Read 2 more answers
What are the 6 external parts of a computer
Sedbober [7]

External computer components connect to the motherboard through a series of ports on the computer case. Many components have their own dedicated port connections, such as those to connect audio equipment or the computer monitor. Others may share a single type of connector, such as the USB, that connects everything from keyboards and mice to game pads and external hard drives. there


8 0
3 years ago
Define a function that takes two arguments: a string called strText and a number called intNumber. This function will use a repe
natima [27]

Answer:

public class Main

{

   public static void printString(String strText, int intNumber) {

       for(int i=0; i<intNumber; i++){

           System.out.println(strText);

       }

   }

   

public static void main(String[] args) {

       

       printString("Brainly", 3);

}

}

Explanation:

- Define a function called <em>printString</em> that takes two parameters - a String and an int. Since the function will print out the given String, it's type will be <u>void</u>.

- Use <em>for loop</em> to iterate according to the given number and print the given string

- In the main, call the <em>printString </em>function with some parameters.

3 0
3 years ago
Read 2 more answers
Are storage devices input devices
Nonamiya [84]

Answer:

Exphfbdplanation:

8 0
2 years ago
Instead of sending an entire file in one big chunk across the​ Internet, __________ is used which dices the file up into little
azamat

Answer:

TCP/IP

Explanation:

TCP/IP which stands for Transmission Control Protocol and Internet Protocol are network protocols which divide your message into smaller chunks or fragments known as network packets and sends them out onto the Internet. When the chunks arrive at the intended destination, TCP/IP on the receiving end reassembles the network packets into the original message.

TCP/IP are the main protocols used for sending data over the internet.

7 0
2 years ago
Other questions:
  • The utilization of a subset of the performance equation as a performance metric is a pitfall. To illustrate this, assume the fol
    13·1 answer
  • The ________ of the operating system enables users to communicate with the computer system. modem window network adapter card us
    14·1 answer
  • Security awareness training can reduce the risk of a data breach by what percentage?
    12·1 answer
  • 1 Point
    14·1 answer
  • Robert works in a call center and receives a call from Kathy. Kathy says she can no longer access the online reporting applicati
    13·1 answer
  • Courses that enable students to begin jobs that require course completion certificates are know as
    8·1 answer
  • Calculate the cash available to retire debt for each of the six months. There is cash available to retire debt if there is a cas
    8·1 answer
  • What are some ways you can give staying off your phone a "boost" and make it easier to do?
    9·1 answer
  • 1. Define the term M.A.N.
    5·2 answers
  • Hosts on the Internet have ________ addresses. Group of answer choices both A and B neither A nor B IP data link
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!