write a c program to print armstrong number
Answers
Answer: mark asa brainliest and follow mec plz
Explanation: int check_armstrong(int); int power(int, int);
int main () { int c, a, b;
printf("Input two integers\n"); scanf("%d%d", &a, &b);
for (c = a; c <= b; c++) if (check_armstrong(c) == 1) printf("%d\n", c);
return 0; }
int check_armstrong(int n) { long long sum = 0, t; ...
t = n;
while (t != 0) { digits++;
Answer:
import java.util.*;
class abc
int main()
{
int num, original, rem, sum = 0, n = 0 ;
printf("Enter a Number: ");
scanf("%d", &num);
original = num;
while (original != 0)
{
original /= 10;
++n;
}
original = num;
while (original != 0)
{
rem = original%10;
sum += pow(rem, n);
original /= 10;
}
if(sum == num)
printf("%d is an Armstrong number.", num);
else
printf("%d is not an Armstrong number.", num);
return 0;
}