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
snow_tiger [21]
2 years ago
5

Write a C++ Program to generate the following output using a loop structure(s).(Do not hardcode the output values!) Include suff

icent comments
8 6 4 2 0

6 4 2 0

4 2 0

2 0

0
Computers and Technology
1 answer:
Gemiola [76]2 years ago
5 0

Answer:

Following are the program in the C++ Programming Language.

#include <iostream> // header file  

using namespace std; // namespace

int main() // main function

{

int n=8; //variable declaration

for(int k=n;n>=0;n-=2) // iterating over the loop to print the format

{

int n1=n;

for(int j=n1;n1>=0;n1-=2)

{

cout<<n1<<" "; // display the format  

}

cout<<endl; // next line  

}

return 0;

}

<u>Output</u>:

8 6 4 2 0

6 4 2 0

4 2 0

2 0

0

Explanation:

Following are the description of the program.

  • Set an integer type variable "n" and initialize in it to 8.
  • Set two for loop, the first loop iterate from the variable "n" that is 8 to 0 with decrement by 2 and next for loop also iterate from 8 to 0 then, print the value of the variable "n1".
  • Finally, we break line after the second for loop.
You might be interested in
Why did hockey champion Haley wickenheiser feel angry after the Bach said the IOC would make a decision in the next month?
aliina [53]

Haley wickenheiser felt angry after the Bach said the IOC would make a decision in the next month as the IOC says the games will be held no later than summer 2021 but they will still be called the 2020 Tokyo Olympics.

Explanation:

  • The Tokyo Olympics were postponed until 2021 on Tuesday, ending weeks of speculation that the games could not go ahead as scheduled because of the coronavirus pandemic.
  • The International Olympic Committee made the decision after speaking with Japanese Prime Minister Shinzo Abe and local organizers.
  • The IOC said the games will be held not later than summer 2021 but they will still be called the 2020 Tokyo Olympics.
  • “President Bach said he will agree ‘100%,’ and we agreed to hold the Tokyo Olympics and Paralympics in the summer of 2021 at the latest,” Abe said, saying holding the games next year would be “proof of a victory by human beings against the coronavirus infections.”
  • The decision came only a few hours after local organizers said the torch relay would start as planned on Thursday.
4 0
2 years ago
To run a PHP application that has been deployed on your own computer you can enter a URL in the address bar of your browser that
svet-max [94.6K]

Answer:

You can enter a URL that (B) Uses localhost as the domain name

Explanation:

Localhost refers to your computer or the computer that is currently in use.

To run a PHP application that is deployed on your computer, the localhost (which has an IP address of 127.0.0.1) is used.

The IP address is called a "loopback" address because all data sent or received revolve around the local computer.

8 0
3 years ago
Join my giggl PLEASE i am so bored link will be in comments
asambeis [7]

Answer:

in which app we had to join

5 0
2 years ago
Read 2 more answers
A ____ is a structure that allows repeated execution of a block of statements.
Leokris [45]

Answer:

loop

Explanation:

Loop is the one which is used to execute the specific statement again and again until the condition is true.

In the programming, there are 3 basic loop used.

1. for loop

<u>Syntax:</u>

for(initialization, condition, increment/decrement)

{

  statement;

}

the above statement execute until the condition in the for loop true when it goes to false, the loop will terminate.

2. while loop

<u>Syntax:</u>

initialization;

while(condition)

{

  statement;

increment/decrement;

}

it is work same as for loop and the increment/decrement can be write after or before the statement.

3. do while

syntax:

initialization;

do

{

   statement;

   increment/decrement;

}while(condition);

here, the statement execute first then, it check the condition is true or not.

so, if the condition is false it execute the statement one time. this is different with other loops.

3 0
3 years ago
Read 2 more answers
In excel what is the biggest disadvantage of copying a worksheet into another workbook?
Mariana [72]
The answer might be wrong and you could get caught
7 0
2 years ago
Other questions:
  • select three types of school which specifically emphasize learning through creativity, self expression, and play
    10·2 answers
  • Create a funtion makeStudent(studentlist) where studentlist is your list of Student namedtuples The function should do the follo
    13·1 answer
  • Your phone's battery dies -- no Internet for you! When you get home hours later, you plug in the charger and turn your phone bac
    6·1 answer
  • Cyberterrorism is the use of terrorism to attack (Points : 1) public libraries. computer based networks. government spy networks
    15·1 answer
  • RAID level ________ refers to disk arrays with striping at the level of blocks, but without any redundancy. A. 0 B. 1 C. 2 D. 3
    7·1 answer
  • How to get out of the verify your identity page on a dell laptop because it won’t let me
    13·1 answer
  • What is the purpose of the domain name​
    5·1 answer
  • You are comparing cryptographic solutions to implement at your organization. Which two items should you focus on when you are ev
    12·1 answer
  • Describe, with examples, the way in which a defect in software can cause harm to a person, to the environment, or to a company
    9·1 answer
  • Are there any Potential Dangers in Artificial Intelligence?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!