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
When hundreds, thousands, or even hundreds of thousands of zombie computers are gathered into a logical computer network under t
Ainat [17]
Virus such as a Trojan or Worm, and can cause network crashes.
4 0
3 years ago
Read 2 more answers
Technologies that function within the established system are called
vesna_86 [32]
<span>Authorizing technologies are technologies that controls the use of system and network resources through authentication and authorization. 
</span><span>Enabling technologies are innovation technologies that drive radical change in the capabilities of a user or culture.
</span>Obstructing technologies include blocking<span> and filtering, content manipulation, attacks.
</span>Preemption means "prior seizure of" and preemptive technologies <span>take control of the operating system from one task and giving </span>it<span> to another task.
</span><span>Technologies that function within the established system are called enabling technologies.</span>
8 0
3 years ago
Rectangle perimeter is 72 .Find the new perimeter if length is doubled and breadth is tripled​
777dan777 [17]

Answer:

Is it related to technology and computers?

3 0
3 years ago
What is the function of a slide transition in a presentation program? A. It enables you to change the presentation layouts. B. I
Lelechka [254]

The answer would be

C. It adds visual effects when you move from one slide to another.

Hope this has helped you! :)

5 0
3 years ago
Read 2 more answers
From the computer desktop, clicking the Start button lets you _____.
stepan [7]
Locate and open Excel
8 0
3 years ago
Read 2 more answers
Other questions:
  • Respecting yourself and others, educating yourself and connecting with others, and protecting yourself and others are all aspect
    9·2 answers
  • 32.
    11·1 answer
  • What special member function of a class is called whenever an instance of a class is created and initialized?
    15·1 answer
  • The ____ function sums the numbers in the specified range and then divides the sum by the number of cells with numeric values in
    14·1 answer
  • I need this ASAP anyone pleas help me i have to do this by tonight
    10·1 answer
  • How are modern computers different from eniac?
    5·1 answer
  • What happens when the following code segment executes if test.txt does not exist?:<br> A,B,C,D?
    7·1 answer
  • Betrand Meyer developed the ______ programming language which is not type-safe because it violates the law of contravariance.
    9·1 answer
  • The scientific process is most similar to what
    10·1 answer
  • Dominic's teacher asked him to create a chart or graph to compare the different grade levels in the school's FBLA club. Which ch
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!