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
Question 4 (1 point)
9966 [12]

Answer:

It would be <u>B</u> because They have there own video game system. They will state little good facts about other brands so they seem bias, but they are.

BTW PlayStation is the best... JK they all do the same thing hope this helps!

<u />

8 0
3 years ago
A service that enables a customer to build and run their own applications but doesn't include extensive access to hardware and m
Musya8 [376]

There are a lot of computer apps. A service that enables a customer to build and run their own applications but doesn't include extensive access to hardware and middleware is PaaS.

<h3>What is PaaS?</h3>

This is known to be one that helps user to install and run their own application on any kind of vendor-supplied hardware and system software.

The Platform-as-a-Service, is said to be a cloud computing model that gives customers a full cloud platform such as hardware, software, and infrastructure that is used for creating, running, and handling applications.

Learn more about PaaS from

brainly.com/question/14364696

8 0
2 years ago
The results of the spec cpu2006 bzip2 benchmark running on an amd barcelona has an instruction count of 2.389e12, an execution t
saw5 [17]

Answer:

CPI = 0.94

Explanation:

The formula for execution time is given below:

Execution time = clock cycles * cycle time

As Execution time = 750 s

clock cycle time = 0.333 ns = 0.333 * 10^-9

so putting these values in the above formula, we get

750 = clock cycles * ( 0.333 * 10^-9 )

clock cycles = 750 / ( 0.333 * 10^-9 )

clock cycles = 2.25 * 10^12

As the results of the spec cpu2006 bzip2 benchmark running on an amd barcelona has an instruction count = 2.389 * 10^12

and the formula for clock cycles is:

clock cycles = number of instructions * CPI

CPI = clock cycles / number of instructions

CPI = 2.25 * 10^12 / 2.389 * 10^12

CPI = 0.94

5 0
3 years ago
A highly available server is available what percentage of the time?
Verdich [7]

Answer:

b. 99.99%

Explanation:

<u>High available server</u>

A typical dedicated server is a strong machine linked to a high-speed Internet connection and located in a state-of - the-art distant data center or optimized information warehouse.

A dedicated High Availability Server is an sophisticated system with redundant network,redundant power supplies and backups to ensure maximum up-time.

5 0
3 years ago
OSHA published Fatality/Catastrophe (FAT/CAT) Reports______ on its web site.
Tema [17]
Worker injuries, illnesses and fatalities. 4,679 workers were killed on the job in 2014 [BLS 2014 workplace fatality preliminary data] (3.3 per 100,000<span> full-time equivalent workers) – on average, almost 90 a week or more than 13 deaths every day.

Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions.
</span>
6 0
3 years ago
Other questions:
  • How important is technology in education? what technology-related skills can you contribute to a school district answers?
    13·1 answer
  • Write a function named printtriangle that receives a parameter that holds a non-negative integer value and prints a triangle of
    7·1 answer
  • To more easily incorporate methods into a program, it is common practice to store methods in their own classes and files. Then y
    6·1 answer
  • When you are printing handouts, which of these can you do?
    6·1 answer
  • 2.36 LAB: Warm up: Variables, input, and casting (1) Prompt the user to input an integer, a double, a character, and a string, s
    12·1 answer
  • Hank is the network administrator responsible for managing the web server cluster for an e-commerce company. He’s worried about
    9·1 answer
  • What are the different steps while solving a problem using computer? explain​
    7·1 answer
  • What is the output of this program?
    10·2 answers
  • In a word-processing program, what are the easily accessible icons that allow you to print, save and change fonts with a click o
    8·1 answer
  • Whats worth more in adopt me- A Mega Owl or a Mega Frost Dragon?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!