Answer:
#include <stdio.h>
#include <math.h>
int is_armstrong(int n) {
int cubedSum = 0;
int r = n;
while (r) {
cubedSum += (int)pow(r % 10, 3);
r = r / 10;
}
return cubedSum == n;
}
int stack_count(int n) {
int sum = 0;
while (n) {
sum += n % 10;
n = n / 10;
}
return sum;
}
int is_magical(int n) {
while (n > 9) {
n = stack_count(n);
printf("%d ", n);
}
return n == 1;
}
int main()
{
int input = 0;
int isMagical, isArmstrong;
while (true) {
printf("Enter a number: ");
scanf_s("%d", &input, sizeof(int));
if (input == -1) break;
isArmstrong = is_armstrong(input);
isMagical = is_magical(input);
if (isArmstrong && isMagical) {
printf("%d is both an armstrong and a magical number.\n", input);
} else if (isArmstrong) {
printf("%d is an armstrong number\n", input);
} else if (isMagical) {
printf("%d is a magical number\n", input);
} else {
printf("%d is neither an armstrong or a magical number.\n", input);
}
}
}
Explanation:
Here is a starting point. What's the definition of a magical number?
What is "Dragon Ball Abridged"?
The most efficient way to communicate would be emailing
Prison or jail with understanding that after a period of time,she or he may petition the court to be released on probation. ......the release of an inmate into a community supervision program at the discretion of the parole board within limits set by state or federal law.
The light is shining on the left side of his face because the shadow is on the other side