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
The conflict between the user's goal for unfettered access to data and the security administrator's goal to protect that data is
rewona [7]

Answer: Access control

Explanation:Access control is the type of security facility that is provided to the systems in an organization. The functions carried out in maintaining the security of the system is done by authenticating , authorizing and identification of the users and related components . They are secured using the PINs , passwords, bio-metric scan etc.

The situation of the user wanting to have a unrestrained access towards data as well as maintaining the security is the done by access control.

8 0
2 years ago
Read 2 more answers
the two main ways in which marketers address the competition with their strategies are by satisfying a need better than a compet
Nonamiya [84]

Offering a lower price (Apex)

4 0
2 years ago
Read 2 more answers
Is the number of hits to a website in a daynumber of hits to a website in a day a discrete random​ variable, a continuous random
marissa [1.9K]

Answer:

The correct answer to the following question will be "It is a discrete random variable".

Explanation:

A variable that assumes algebraic expressions defined by a randomized occurrence result, is a Random variable.

  • There are several potential or possible values for a single randomized variable.
  • A discrete random variable's chances for each value is between 0 (zero) and 1 (One), as well as the total amount among all possible outcomes, is equitable to 1.

So, a Discrete random variable is the right answer.

3 0
3 years ago
Read 2 more answers
Using the FAFSA form , you can for apply for what
AlladinOne [14]

apply for financial aid for college or grad school.

7 0
3 years ago
Read 2 more answers
Which team behavioral characteristic helps team members to freely express ideas and foster approachability?
vlada-n [284]

Communication is the right answer.

6 0
3 years ago
Other questions:
  • Print "Censored' if userlnput contains the word "darn, else print userlnput. End with newline. Ex: If userinput is "That darn ca
    11·1 answer
  • Brainliest to whoever can guess what year this corvette logo is from. Make your guesses
    11·1 answer
  • Mathematical computations by a computer are faster than your quickest mathematical computations because the top speed of a neura
    13·1 answer
  • My 2 in 1 laptop/tablet
    13·1 answer
  • What the repeal of online privacy protections means for you?
    8·1 answer
  • What is the first and last value of i to be displayed by the following code snippet? int n = 20; for (int i = 0; i &lt;= n; i++)
    10·1 answer
  • Your task is to write and test a function which takes one argument (a year) and returns True if the year is a leap year, or Fals
    5·1 answer
  • TP1. लेखा अभिलेखको अर्थ उल्लेख गर्नुहोस् । (State the mea
    15·1 answer
  • Who is your favorite person from squid game?
    13·2 answers
  • Which type of information should never be given out on social media?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!