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
frosja888 [35]
3 years ago
7

Output a table that show the cube of the numbers 1-15 (C++)

Computers and Technology
1 answer:
Rainbow [258]3 years ago
3 0

Answer:

The c++ program to display cube of numbers from 1 to 15 is given below.

#include <iostream>

using namespace std;

int main() {    

   // variables declared and initialized  

   int num = 15, k, cube;    

   cout << " Cubes of numbers from 1 to 15 are shown below " << endl;    

   for( k = 1; k <= num; k++ )

   {

       // cube is calculated for each value of k and displayed

       cube = k * k * k ;

       cout << " \t " << cube << endl;

   }

return 0;

}

 

OUTPUT

Cubes of numbers from 1 to 15 are shown below  

  1

  8

  27

  64

  125

  216

  343

  512

  729

  1000

  1331

  1728

  2197

  2744

  3375

Explanation:

The variables are declared and initialized for loop, cube and for condition in the loop – k, cube, num respectively.

Inside for loop which executes over k, beginning from 1 to 15, cube of each value of k is calculated and displayed. The loop executes 15 times. Hence, cube for numbers from 1 to 15 is displayed after it is calculated.

   for( k = 1; k <= num; k++ )

   {

      cube = k * k * k ;

       cout << " \t " << cube << endl;

   }

In the first execution of the loop, k is initialized to 1 and variable cube contains cube of 1. Hence, 1 is displayed on the screen.

In the second execution, k is incremented by 1 and holds the value 2. The variable cube contains cube of 2, which is calculated, and 8 gets displayed on the screen.

After each execution of the loop, value of k is incremented.

After 15 executions, value of k is incremented by 1 and k holds the value 16. This new value is greater than num. Hence, the loop terminates.

You might be interested in
You are the administrator of a Windows network. When creating a new user account, you specify a security clearance level of top
dezoksy [38]

Answer:

MAC (Mandatory access control)

Explanation:

Mandatory access control is a type of access control.MAC is a strategy that are defined by system administration. MAC access is controlled by administration.  Administrative security access training, security awareness , written policies and procedures, incident response plan , agreements and background checks.                        

4 0
3 years ago
Which specialized information system is used by passport agencies and border inspection agencies to check the names
katovenus [111]

Answer:

Consular Lookup and Support System

5 0
2 years ago
What authentication protocol is ticket-based and is used by windows computers that are members of an active directory domain?
Temka [501]
Your IP address, also known as Internet Protocol
7 0
3 years ago
I'm trying to move the figure a little away from, the column line and every time I move it and click ok it goes back to being be
Luba_88 [7]

Answer:

Try to click the center button layout.

Explanation:

8 0
3 years ago
Which of the following recommendations should you follow when placing access points to provide wireless access for users within
Colt1911 [192]

A WLAN, or wireless local area network, is created by an access point, typically in an office or big building. An access point transmits a Wi-Fi signal to a predetermined region after connecting via an Ethernet cable to a wired router, switch, or hub. Thus, option C is correct.

<h3>What access points to provide wireless access for users?</h3>

You may determine your wireless access point IP address by going to the settings menu of your adapter if you're already connected to the network via Wi-Fi or Ethernet.

Therefore, Open Network & Internet settings can be accessed by selecting with the right mouse click on the network icon in the system tray.

Learn more about wireless access here:

brainly.com/question/13073711

#SPJ1

6 0
1 year ago
Other questions:
  • Choose the type of critical thinking demonstrated in the example:
    8·2 answers
  • write a method that will return a person's age entered by keyboard. You will need to include at least one instance variable in t
    11·1 answer
  • The function below takes a string argument sentence. Complete the function to return the second word of the sentence. You can as
    5·1 answer
  • Hey I don’t have a question I’m just testing something on this app
    6·2 answers
  • PLEASE HURRY!!!
    11·1 answer
  • A different way of pronoucing the same words is called a _____
    15·1 answer
  • Difference between statement x=+5 and x+=5​
    7·1 answer
  • Match the following.
    8·1 answer
  • Do you have any sprites for Friday Night Funkin?
    14·1 answer
  • What are two potential benefits of using calendar-synchronization tools like calendly
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!