Armstrong Number1
Submit solution
C
Points:
10 (partial)
Time limit:
8.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Get a sequence of numbers from the user and check if those numbers are armstrong numbers. Armstrong number is a number that is equal to the sum of cubes of its digits.
Sample Input
3
122
370
371
Sample Output
No
Yes
Yes
Explanation
The first line in the Sample Input contains the number of inputs given, Your program should work for any number of inputs. The next lines contain the input values. The Sample Output has the value Yes if armstrong number, otherwise No.
Comments
include <stdio.h>
include <math.h>
int is_armstrong_recursive(int number, int originalNumber, int digitCount) { if (number == 0) { return originalNumber == 0; }
}
int is_armstrong(int number) { int digitCount = 0; int temp = number;
}
int main() { int number; printf("Enter a number: "); scanf("%d", &number);
}