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
7nadin3 [17]
3 years ago
11

Special numeric has three digits and holds a property that it is exactly equal to summation of cubes from each digit. For exampl

e, 370 is an element named special numeric. 370 = 3 3 + 7 3 + 0 3 . Write a C program to explore these special integer numbers from 100 to 999 and display all of them on screen. You can use for loop. Name your program f
Computers and Technology
1 answer:
Vera_Pavlovna [14]3 years ago
8 0

Answer:

The following code is written in C programming language:

#include <stdio.h>     //header file

 

int main()       //main method

{

   int n, t, digit1, digit2, digit3;      // set integer variables

    // print message

   printf("Print all Special integer numbers between 100 and 999:\n");

   n = 100;      //initialize value in variable "n"    

   while (n <= 999)      //set while loop

   {

       digit1 = n - ((n / 10) * 10);

       digit2 = (n / 10) - ((n / 100) * 10);

       digit3 = (n / 100) - ((n / 1000) * 10);

       t = (digit1 * digit1 * digit1) + (digit2 * digit2 * digit2) + (digit3 * digit3 * digit3);

       if (t == n)      //set if statement

       {

           printf("\n Special integer number is: %d", t);     //print an output

       }

       n++;

   }

}

Output:

Print all Special integer numbers between 100 and 999:

Special integer number is: 153

Special integer number is: 370

Special integer number is: 371

Special integer number is: 407

Explanation:

Here, we set the header file "stdio.h".

Then, we define integer type "main()" function.

Then, we set five integer type variable "n", "t", "digit1", "digit2", "digit3".

Then, we the print message by print() method and initialize a value to variable "n" to 100.

Then, we set the while loop which starts from 100 and stops at 999 and if the condition is true than code inside the loop is execute either loop is terminated.

Then, we set the if statement and pass the condition, if the condition is true the output would be print either if the condition is false the if statement is terminated.

You might be interested in
1. Which of the following are considered CAD powerhouses?
allsm [11]

Answer:

1. D.Autodesk and microstation.

2. D. the creation of a computer model, paricularly for purposes of studying.

3. A.internet delivered through standard household phone lines.

4. C.3-D sculptures used to pray for fertility.

5. C.technology.

Explanation:

8 0
3 years ago
Online library catalogs can direct you to your closest library. (1 point)<br> True<br> False
Kitty [74]

Answer:

True

Explanation:

8 0
3 years ago
Write a for loop that computes the following sum: 5+10+15+20+...+485+490+495+500. The sum should be placed in a variable sum tha
Strike441 [17]

Answer:

public class num9 {

   public static void main(String[] args) {

       int sum =0;

       int num =5;

       for(num =5; num<=500; num+=5){

           System.out.println(num);

           sum +=num;

       }

       System.out.println(sum);

   }

}

Explanation:

  • Declare and initialize the variables sum and num
  • Use a for loop with the condition for(num =5; num<=500; num+=5) Since the loop will increment by 5 and run from 5 to 500
  • Within the loop, add num to sum at each iteration
  • Print all elements on seperate lines
  • Outside the loop, print the final value of sum

Create a for loop

6 0
3 years ago
List safety conditions when downloading shareware, free free where, or public domain software
Anit [1.1K]

Answer:

Explanation:

Freeware and shareware programs are softwares which are either free of charge or consist of a free version for a certain trial period. These programs pose a threat of habouring malware or viruses which could damage one's computer and important files and programs. Therefore, it is imperative that carefulness is maintained when trying to get these softwares.

Some of the necessary safety conditions that should be taken include;

1) Appropriate research about the software including taking more about the vendors and reviews.

2.) Once, a healthy review has been identified ; the download can begin with the Downloader ensuring that the download is from the recommended site.

3) Prior to installation the software should be scanned with an active anti-virus program to determine if there is possibility that a virus has creeped in.

4.) Some softwares may require that computer anti-virus be turned off during installation, this is not always a good idea as this act leaves the system vulnerable a d badly exposed.

6 0
2 years ago
An instance variable name of type String, initialized to the empty String. An instance variable score of type int, initialized t
timofeeve [1]

Answer:

public class Class {

   private String name ="";

   private int score = 0;

   //Method SetName

   public void setName(String newName){

       name = newName;

   }

//Method SetScore

   public void setScore(int newScore){

       score = newScore;

   }

//Method GetName

   public String getName() {

       return name;

   }

//Method GetScore

   public int getScore() {

       return score;

   }

}

Explanation:

  • The class called Class is implemented in Java programming language
  • It has two fields (instance variables name and score)
  • Methods for setting the values of variables (mutator methods) or setters
  • Methods for getting the values of the variables (accessor methods) getters
8 0
3 years ago
Other questions:
  • A short-term job or work project that can be paid or unpaid and can lead to a full-time, paying position is called a(n) _____.
    5·2 answers
  • This type of peripheral is used to interact with, or send data to, the computer.
    12·2 answers
  • True or false. Embedding only part of a font is called presetting.
    14·1 answer
  • Which style of leadership would be most helpful to Charles in the following situation? Charles has just started an internship at
    15·1 answer
  • You wrote a C application that takes 20 seconds using your desktop processor. An improved C compiler is released that requires o
    6·1 answer
  • Need help please will mark brainliest
    15·1 answer
  • To access your gradebook you click on the __________.
    6·2 answers
  • Assume there are two variables, k and m, each already associated with a positive integer value and further assume that k's value
    13·1 answer
  • Rachelle is writing a program that needs to calculate the cube root of a number. She is not sure how to write the code for that
    10·2 answers
  • reagan's firm has not had to make large investments in computer or networking hardware or in personnel to maintain the hardware
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!