Skip to content

Commit d62651e

Browse files
no change
1 parent 34f7417 commit d62651e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

numbers4.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main()
1212
void is_armstrong(int n)
1313
{
1414
int reminder,count=0,sum=0,i,num=n,num1=n;
15-
// this part will find numbers of digits of entered number and store in count
15+
// Find the numbers of digits of input number and store it in count.
1616
while(n!=0)
1717
{
1818
reminder=n%10;
@@ -21,7 +21,7 @@ void is_armstrong(int n)
2121

2222
}
2323
printf("This number has %d digits \n",count);
24-
// this part will raise the power of digits to last number and calculating sum
24+
// Calculate the sum of the digits raised to the power of the number of digits.
2525
for(i=0;i<count;i++)
2626
{
2727
reminder=num%10;
@@ -30,6 +30,7 @@ void is_armstrong(int n)
3030

3131
}
3232
printf("Sum is %d \n",sum);
33+
// Check if the sum of the digits is equal to the original input number.
3334
if(sum==num1)
3435
{
3536
printf("Entered number is an armstrong number \n");

numbers4.exe

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)