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]
3 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]3 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
Cost, time, knowledge are examples of
Katena32 [7]
They are examples of constraints.
8 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
tiny-mole [99]

Answer:

Modern CPUs contain multiple cores.  Think of it as multiple smaller CPU's on the single CPU chip.  The multiple cores can handle different processes in parallel allowing for multiple programs to be running at the same time.  This is not considered true multi-processing since the architecture still has a single I/O bus and can be subject to a single point of failure.  But the operating system will take advantage of the additional cores as if they were multiple physical CPU's - enhancing performance and productivity.

Explanation:

7 0
3 years ago
Scale-based classification for networks allows us to differentiate PANs, LANs, MANs, and WANs. Moreover, the structure of a netw
Nana76 [90]

Answer:

1. PANs uses Star Topology.

2. LAN uses four topology (Bus, Ring, Star and Tree).

3. MAN uses Star Topology.

4. WAN uses Bus topology.

Explanation:

1. PAN is the personnel area network, in which different personnel devices of a person are connect to each other with the help of the central computer with the help of Bluetooth, WiFi or some other medium. The central computer will work like a hub and all the devices are directly connected to the central PC. It is same as the ring topology where all the devices are connected to the central PC. So we can say that, PANs use star topology.

2. LAN is the local area network that has been established with in the premises of the organization. In this type of network, four typologies involve to complete the network connection. First is star topology, that is used to connect all the devices with the switches. Then Bus topology is used to connect all the switches with the single main cable. Ring topology is involved to connect all the switches with each other. Tree topology is used to connect different block if the organization in the form of branch to connect the central router or switch.

3. MAN is the Metropolitan Area Network which is comprise of different LANs. All the LANs are connected to the Router in the form of Star topology.

4. WAN is the wide area network. In WAN different MANs are connected to the network through single cable. This type of network uses Bus topology.

6 0
4 years ago
I'm getting pretty desperate plz help me, I'll give brainiest, and ill make a free question worth 100 points this is for coding
Oksana_A [137]

Answer:

Pseudocode:

import random

fetch user input on a lucky number

insert input into variable - "response"

new variable, random = randint

condition to check wheather random is our response

display results

Python Code:

import random

def main():

response = int(input("Guess my lucky number, its between 1 and 100: "))

lucky_number = random.randint(1,100)

if response == lucky_number:

print(f"Wow you're right, it is {lucky_number}")

else:

print("Sorry, Try Again")

main()

Reminder:

intended for python3 as i included the format f

also it could be done without the import, just manually insert a number

i'll leave the post mortum to you

Explanation:

3 0
3 years ago
The greatest common divisor of two positive integers, A and B, is the largest number that can be evenly divided into both of the
lapo4ka [179]

Explanation: Surface Level

5 0
3 years ago
Other questions:
  • Which of these computers was marketed as a computer/game machine?
    15·2 answers
  • Design aPayrollclass that has fields for an employee’sname, ID number, hourly pay rate,and number of hours worked. Write theappr
    9·1 answer
  • How does sugar dissolve in water ? &amp; Read Carefully ?
    9·1 answer
  • Firewall ____ indicate whether a large number of echo messages are being received.
    9·1 answer
  • Which benefit does the cloud provide to star-up companies without access to large funding?
    11·1 answer
  • It is important to understand the different types of DoS attacks and the symptoms of those attacks. Leaving a connection half op
    15·1 answer
  • B. Directions: Fill in the blanks with the correct answer.
    13·1 answer
  • What is the most appropriate data type for each of these items?
    15·1 answer
  • Which html tag designates links to other web pages?.
    15·1 answer
  • Which practice enables recovery of accidental deletions in data records?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!