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
zhuklara [117]
2 years ago
11

Write a C++ nested for loop code to print out the following onthe screen1 2 3 4 5 67 8 91 2 3 4 5 67 81 2 3 4 5 671 2 3 4 561 2

3 451 2 341 23121
Computers and Technology
1 answer:
Mekhanik [1.2K]2 years ago
6 0

Answer:

#include<iostream>

using namespace std;

//main function

int main(){

   

  //nested for loop

   for(int i=9;i>=1;i--){

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

          cout<<j<<" ";  //display

       }

   }

   return 0;

}

Explanation:

Include the library iostream for using the input/output instruction in the c++ programming.

Create the main function and takes nested for loop. Nested for loop means, for loop inside the another for loop.

For every value of outside for loop, inside for loop execute.

we make outer for loop in decreasing format, means it start from 9 and goes to 1 and inside for loop make in increasing format, means loop start from 1 and it goes to that value which is provided by the outer loop.

and print the output for every cycle.

Lets dry run the code:

the outer loop starts from 9 and it checks the condition 9>=1, condition true. then the program moves to the inner loop which starts from 1 and goes to the 9.

first, it also checks the condition 1 <= 9, condition true and prints the number from 1 to 9.

then,  i is reduced by 1. it means i become 8.

then, the above process continues from 1 to 8 and so on...

the loop process will terminate if the outer loop terminate.

Finally, we get the output.

You might be interested in
What may happen if a large number of computer users are trying to access a web site at the same time as you ?
Ber [7]
It Will Say " Too Many People At A Time Trying To Get In " And It Will Say Wait .
6 0
3 years ago
How operands are fetched from or stored into memory using different ways?
Mila [183]
<span>The operand is part of the instruction and is fetched from code memory following the instruction opcode.
</span><span>The value is stored in memory, and the specific address is held in a register</span>
6 0
3 years ago
Three different filters are incorporated into the detector packet of the optically stimulated luminescence (OSL) dosimeter. Thes
TEA [102]

Answer: Aluminum, tin, and copper

Explanation: Optically stimulated luminescence (OSL)  is a method in which the ionizing radiation help in measuring of the doses. It has working dependent on the radioactivities which are present in the sediments.

The filters that are used for detection of the OSL is usually made of aluminium , copper or tin because the can easily detect isotopes in the sediments which is cause by minerals like uranium etc.

7 0
3 years ago
Quick please, URGENT
Serjik [45]

Answer: it is the code it is wrong

Explanation:

8 0
2 years ago
What are some potential challenges that society will face given the digital revolution? You may want to think particularly of th
Feliz [49]

Answer:

Some said that technology causes more problems than it solves. ... Others said humans' uses and abuses of digital technologies are causing ... Highly technological societies have to be iterative if they hope to ... where we believe we can tell honestly delivered information from fake news and disinformation.

hope this helps...

Explanation:

7 0
3 years ago
Other questions:
  • Help plz
    5·1 answer
  • What type of desktop system is Sarah using in the following scenario? Sarah types the phrase “Open Document 3” onto a black scre
    12·1 answer
  • Clicking on this will minimize all open windows.
    5·2 answers
  • Alkane is a Variety of which fruit
    6·1 answer
  • The Warn-on-Forecast has been developed by the National Weather Service to help predict hazardous weather earlier. Which of the
    10·2 answers
  • Graphic characters used to identify items on an unordered list first line indent is called _______
    8·1 answer
  • What is the hexadecimal equivalent of the decimal number 256?
    11·1 answer
  • Digital on a smart phone means the camera is actually zooming in on the photo itself not the subject that you are shooting true
    8·1 answer
  • If a employee has a grade grater than or equal to 18, then he she will get 50% bonous on the basic pay. Otherwise, the employee
    5·1 answer
  • How do I change my username/display name
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!