Hello Coding Students welcome to my programming shortcut
Today write a program to check a number is an Armstrong number or not in c .
What are Armstrong numbers ?
Armstrong number is a number that is equal to the sum of the cube of each digit number
Example of Armstrong number
So 153 is an Armstrong number
printf(“Enter a number :\n”);
while(n>0) /*inner loop to calculate sum of cube of digits*/
}/*End of while loop*/
printf(” %d is a armstrong number”,num)
printf(“%d is not armstrong number, Please try other number”,num);
Enter a number: 123
123 is not Armstrong number, Please try another number
Enter a number: 153
153 is an Armstrong number
I make this program and hope you like the post if you like the post you can please comment and share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting email@example.com us form is given on the page’s right side.
Share your experience with this post,
Leave a Reply