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
fiasKO [112]
3 years ago
8

Find all three-digit numbers with non-zero first digit that are equal to the sum of the cubes of their digits.

Computers and Technology
1 answer:
Strike441 [17]3 years ago
3 0

Answer:

Here is code in C++.

//include header

#include <bits/stdc++.h>

using namespace std;

// main function

int main() {

// check for all three digit numbers

for(int x=100;x<=999;x++){              

          int num = x;

          // find 1st,2nd and 3rd digit

          int d1 = x%10;                    

          int d2 = (x/10)%10;            

          int d3 = x/100;

          // calculate sum of cube of all three digits

          int sum=pow(d1, 3)+pow(d2, 3)+pow(d3,3);

          // if sum is equal to number then print it

         if(sum == num){

              cout<<num<<endl;

          }

}

return 0;

}

Explanation:

Check all the three digit numbers, if the sum of cubes of digits is equal to the number or not.First extract all three digit and then calculate their cubes. Then sum all those three value And then check if the sum is equal to the number or not.If the sum is equal to number then print the number.

Output:

153

370

371

407

You might be interested in
Identify the use of queue in the process of spooling output to a printer.
sashaice [31]

The queue makes sure the printer prints each sheet of paper in order.

6 0
3 years ago
True or False? To use a C++ library function, you must use an #include directive to include the appropriate header file.
lakkis [162]

Answer:

True

Explanation:

While programming in most programming languages, one will have need to use functions and variables defined in other class libraries. in C++, these functions and variables' definitions are contained in Header files, which can be imported and used into any C++ program by using the pre-processor #include statement. This statement is the equivalent of import in java and copy in other languages. Popular header files are the Maths class (Allows use of maths functions like power, square roots exponentiation etc), the input/output (allows usage of cout print statement and cin input statement)

7 0
3 years ago
If you create a column break, what happens to the text after the insertion point?
Ugo [173]

Answer:

It moves to the top of the next column.

5 0
3 years ago
Hardy doesn't have access to a work template, which is on the network server. What should he do?
Anton [14]

He should go to a desktop computer that is attached to the network server to access it

7 0
4 years ago
Read 2 more answers
An analyst suggests that the lower the number of clusters, would give us the strongest and most meaningful result, as opposed to
WARRIOR [948]

Answer:

a. True

Explanation:

Various studies have shown that this is true. Clusters allow you to group together large sets of data into smaller groups in order to find similarities between all the data. Having a smaller number of clusters has been proven to allow you to discover much simpler similarities which can have a much greater impact. Larger sets can help in discovering more unique similarities but they do not have as large of an impact and are less meaningful. This is also why it is recommended to have a lower number of clusters when analyzing data sets.

4 0
3 years ago
Other questions:
  • What is the value of the variable result after these lines of code are executed?
    5·2 answers
  • How to allow all users to access a program?
    12·1 answer
  • Your mother wants to purchase a larger hard drive for her computer and asks you to see what type of drive interface she has. her
    6·2 answers
  • What are listed in the vertical columns across the top of the Event Editor?
    5·2 answers
  • 4.In order for a driver to graduate from a learner’s license to an operator’s license, how many hours of driving need to be docu
    11·1 answer
  • If you have an equipment failure while driving on an expressway, you should
    8·1 answer
  • When a primitive type variable is passed as an argument to a method, what is passed into the receiving method's parameter variab
    12·1 answer
  • Match each item with a statement below. - A popular port scanners that has the ability to use a GUI front end - Allows you to pi
    8·1 answer
  • Select the correct locations on the image. Adrian wants to delve into database administration. Which certifications would help h
    5·1 answer
  • A _________ attack is an attack on a computer system or network that causes a loss of service to users.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!