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
What is a layer, in the context of this lesson?
pshichka [43]

Answer:

A logical unit of a system.

Explanation:

i'm thinking your are talking about system layers such as the ISO? Layers help identify the order of how the whole system works.

7 0
3 years ago
Read 2 more answers
Which of the following solutions enables simultaneous digital transmission of voice, video, data, and other network services ove
Annette [7]

Answer:

3. ISDN

Explanation:

ISDN ( Integrated Services Digital Network  ) -

It is the used for the simultaneous digital transmission of network service , data , video and voice , instead of the old circuits of the public switched telephone network ( PSTN ) , is referred to as ISDN .

The characteristic feature of ISDN is that it integrates the data and speech on the same lines , which is not possible in PSTN .

Hence, from the given information of the question,

The correct option is ISDN .

8 0
2 years ago
4. The clutch pedal is found in cars with manual and automatic transmissions.
kicyunya [14]
False. The clutch only exists in vehicles with manual transmissions.
8 0
3 years ago
.Suppose some functions have been entered into a local file named "weather.js". Write the correct SCRIPT tag to load the library
Doss [256]

Answer:

<script type="text/javascript" src="weather.js"></script>

Explanation:

we have to use above script tag to include weather.js file into our web page.

Here type attribute represents the type of the file which we are trying to include on the web page.src attribute represents the path of the file from where we want to include that into our web page.

Generally we can include our java script functions into web page in 2 ways. one is inline function we can write the code in web page <script> tag itself .another way is to write the code in a separate file as shown above and include it in the webpage

5 0
3 years ago
Sarah is a busy real estate agent with a growing clientele. She is looking to purchase a new computer and software so that she c
lyudmila [28]

Answer:

ASP.NET ,C#.NET,SQLServer,HTML,JavaScript

Explanation:

To build any web based application we need one presentation layer(HTML)

and for client side scripting JavaScript.

ServerSide ASP.NET Technology  and C#.NET to write your business layer

Sql programming to store data in sql server

5 0
3 years ago
Other questions:
  • Which of the following tasks would a database administrator perform ? A identify computer security photos, B. Make sure protocol
    15·1 answer
  • Read the scenario, and then answer the question that follows.
    10·1 answer
  • Rate is how fast a screen updates the information being displayed.
    6·2 answers
  • Moore's Law postulates that:This task contains the radio buttons and checkboxes for options. The shortcut keys to perform this t
    6·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
  • I love science its my favorite subject
    13·2 answers
  • An analogue sensor has a bandwidth which extends from very low frequencies up to a maximum of 14.5 kHz. Using the Sampling Theor
    9·2 answers
  • Define a query that uses the Natural Join command to join three tables to produce useful information.
    14·1 answer
  • The process of sending a result back to another part of the program is
    14·1 answer
  • What science category includes physics and biology?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!