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
kvasek [131]
3 years ago
10

Write a program that prints the following 45 pairs of numbers:

Computers and Technology
1 answer:
nadezda [96]3 years ago
8 0

Here is code in C++ to print the following 45 pairs of numbers:

11 21 22 31 32 33 41 42 43 44 51 ...

// include header

#include <bits/stdc++.h>

using namespace std;

//main function

int main() {

//declare variables

int count=0;

int flag=1;

// for loop to print the pattern

for(int i=1;;i++)

{

for(int j=1;j<=i;j++)

  {

// this will print the pairs in vertical manner

     cout<<i<<j<<endl;

//cout<<i<<j<<""; //this will print horizontally

// this will keep count to print only 45 pairs

count++;

// if count is equal to 45 then it will break the inner loop

     if(count==45)

     {

         flag=0;

         break;

     }

}

   // if the flag is eqaul to 45 then it will break the outer loop

   if(flag==0)

     break;

}

return 0;

}

Explanation:

First declare and initialize two variables "count=0" & "flag=1". Here variable

"count" is use to print only 45 pairs and "flag" is used to break the loop when 45 pairs of numbers are printed.In the nested for loop, for every value of i,j will run from 1 to i and print i then j without any space. After every pair, count will incremented by 1. It will check if "count" is greater than 45 or not. If "count" is greater than 45 then it make flag=0 and break the loop. in the outer for loop, if flag is 0 then it break the outer for loop.

Output:

11 21 22 31 32 33 41 42 43 44 51 52 53 54 55 61 62 63 64 65 66 71 72 73 74 75 76 77 81 82 83 84 85 86 87 88 91 92 93 94 95 96 97 98 99

You might be interested in
An op amp requires the design equation vout = 50vin 3vref agvg. what is the value of ag?
stich3 [128]
The possible solution for this kind of problem is to equate the said equation base on what is ask in the problem.  The design equation is use to get the Voltage out of a said circuit, thus, without any value of resistance, the left and side value of the equation should be the same, and the said problem is generally incomplete. With that, the possible answer would be -53.
4 0
4 years ago
Conceptual note-taking is the act of writing down information in the order it is given. drawing attention to details with a mark
Dvinal [7]

Answer:A

Explanation:Conceptual notetaking is the act of writing down information in the order it is given.

4 0
3 years ago
Read 2 more answers
if you dont' have access to nessus, which of the following can be used by an attacker to gain information about remote *nix host
galina1969 [7]

The NMap procedure that can be used to help you to gain information about remote *nix hosts is Script Scanning

<h3>What is script scanning?</h3>

The script scanner is known to be tool that acts as a measure component to the real Windows scripting host component as it helps to intercepts scripts, and also scans them before they are said to be executed.

Therefore, The script scanner is known to be tool that acts as a measure component to the real Windows scripting host component as it helps to intercepts scripts, and also scans them before they are said to be executed.

Learn more about Script Scanning from

brainly.com/question/18152781

#SPJ11

4 0
2 years ago
In most languages, if a file does not exist and a program attempts to open it in append mode, what happens?
chubhunter [2.5K]

Answer:

It create a new file in which writing of data begins.

Explanation:

A file can be open in the three mode:

-r (Read mode): open an existing file for the purpose of reading data from it.

-w (write mode): Create a new file for the purpose of writing data to it.

-a (append mode): open an existing file for the purpose of appending extra data to it but if the file does not exist, it create a new file and start writing data to it.

5 0
4 years ago
_____ uses computer-generated, three-dimensional images to create the illusion of interaction in a real-world environment.
mr_godi [17]

Answer:

"Virtual reality" is the appropriate answer.

Explanation:

The utilization of technological advances gives the impression of a 3D interactive environment wherein the things that have such a perception of space embodiment or involvement, are considered as Virtual reality.

Virtual reality implementations often include:

  • Entertainment,
  • Medical and
  • Educational activities.
3 0
3 years ago
Other questions:
  • A device that produces a permanent human-readable text of graphic document.
    15·1 answer
  • Match terms in the first column with the order descriptions in column two.
    11·1 answer
  • The ____ of an identifier refers to where in the program an identifier is accessible (visible).
    10·1 answer
  • You want to boot a linux system into singer user mode/ what options might you add to a linux kernel options list in a boot loade
    9·1 answer
  • Which of the following is considered a period cost in absorption​ costing? A. variable manufacturing overhead costs B. fixed man
    7·1 answer
  • QUESTION
    14·1 answer
  • What technology is being used instead of Adobe flash player​
    8·1 answer
  • Rebecca is an interior designer. What is her job role? need this asap
    9·1 answer
  • Would you rather be rich and unknown or famous and poor
    9·1 answer
  • What is a zerø-day exploit? No go.ogle &gt;:(
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!