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
Write a program TwoSmallest.java that takes a set of double command-line arguments and prints the smallest and second-smallest n
aliina [53]

Answer:

The following code is written in java programming language:

public class TwoSmallest {   //define class

   public static void main(String[] args) {     // define main function

       if (args.length < 2) {     //set the if condition

           System.out.println("Enter double values as command line arguments");

       } else {

           double minimum1 = Double.parseDouble(args[0]), minimum2 = Double.parseDouble(args[1]), n;

           if (minimum1 > minimum2) {    //set the if condition

               double temp = minimum1;

               minimum1 = minimum2;

               minimum2 = temp;

           }

           for (int i = 2; i < args.length; i++) {      //set the for loop

               n = Double.parseDouble(args[i]);

               if (n < minimum1) {

                   minimum2 = minimum1;

                   minimum1 = n;

               } else if (n < minimum2) {

                   minimum2 = n;

               }

           }

           System.out.println(minimum1);

           System.out.println(minimum2);

       }

   }

}

Explanation:

Here, we define a class "TwoSmallest" with public modifier.

Then, we define the main method.

Then, we set if condition and pass condition "args.length < 2".

Then we take three double type variable "minimum1", "minimum2" and "n".

Then, we set the if condition and pass condition if "minimum1 > minimum2", then set double type "temp" variable and swap between temp, minimum1 and minimum2.

Then, we set the for loop which is start from 2 and stops at "args.length"

Then, we set if condition and then we set its else part, after that we print the value of minimum1 and minimum2.

7 0
4 years ago
A new PKI is being built at a company, but the network administrator has concerns about spikes of traffic occurring twice a day
kipiarov [429]

Answer:

Option A (CRL) is the right answer.

Explanation:

  • Certificates with respective expiration date canceled mostly by CA generating or providing them, then it would no longer be tolerated, is considered as CRL.
  • CRL verification could be more profitable for a platform that routinely manages several clients, all having pronouncements from a certain CA, because its CRL could be retrieved once per day.

Other given choices are not connected to the given scenario. So Option A is the right one.

7 0
3 years ago
Users are reporting Internet connectivity issues. The network administrator wants to determine if the issues are internal to the
Anika [276]

Answer:

traceroute.

Explanation:

Traceroute these are the computer networking commands and they are used to determine the path or route that data packets take on the network with the delays that are associated with it.So according to me traceroute is the best tool to determine the issues or outrages are in the internet connectivity.

8 0
3 years ago
Count Uppercase, Lowercase, special character and numeric values
Rina8888 [55]

Answer:

View Image

Explanation:

  1. Import the <em>#include <ctype.h> </em>so that you can use the function to check the characters in the string.
  2. Create variable to store letter counts and user input.
  3. Ask for user input with scanf().
  4. Loop through the user input and check each character. Increase count accordingly.
  5. Print out final result.

7 0
4 years ago
Read 2 more answers
What is property in educational technology
Maslowich
1. It is based on scientific and technological advancements.
2. It is more a practical discipline and less a theoretical one.
3. It is a fast growing modern discipline.
4. It makes use of the research findings of psychology, sociology, engineering, sciences and social psychology etc., and applies the same to the field of education.
5. It brings pupils, teachers and technical means together in an effective way.
6. It is the science of techniques and methods. It locates the problems in the field of education, remedies them and ultimately aims at improving the education system.
7. It is bound to improve the teacher, the learner and the teaching learning process.
3 0
3 years ago
Other questions:
  • Alice has to move around a lot to fetch objects at her workstation. Which ergonomic principle should Alice follow to prevent str
    8·2 answers
  • Walt needs to ensure that messages from a colleague in another organization are never incorrectly identified as spam. What shoul
    14·2 answers
  • Write a function named print_backward that accepts a String as its parameter and prints the characters in the opposite order. Fo
    12·1 answer
  • Editing and sorting the data file are steps performed during the ________ stage in the data processing cycle
    5·1 answer
  • What are the two types of computers
    15·2 answers
  • Technologies that allow for instant worldwide communication include satellite and computer systems. mobile phones and internet a
    8·2 answers
  • Which of the following is an example of a consumer
    14·2 answers
  • The purpose of a report is to
    13·1 answer
  • How many of yall are willing too sub to my channel called "Space Juice" with around 200 subs?!​
    14·1 answer
  • The <br> is an image at the top of the page that includes the title.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!