Computer Science, asked by aditipurohit1630, 9 months ago

w a p to check the number whether it is armstrong or not(iterative construct)​

Answers

Answered by pinkikumari156
1

Answer:

sorry bhi I don't no

Answered by immiestriker282
1

Answer:

#include <stdio.h>

int main()

{

int num, originalNum, remainder, result = 0;

printf("Enter a three-digit integer: ");

scanf("%d", &num);

originalNum = num;

while (originalNum != 0) {

// remainder contains the last digit

remainder = originalNum % 10;

result += remainder * remainder * remainder;

// removing last digit from the orignal number

originalNum /= 10;

}

if (result == num)

printf("%d is an Armstrong number.", num);

else

printf("%d is not an Armstrong number.", num);

return 0;

}

Explanation:

Output

Enter a three-digit integer: 371

371 is an Armstrong number.

Similar questions