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.