Quick actions

cmd+k|ctrl+k

Navigation

Languages

Amstrodam

Snippet info

Language

C

Visibility

public

Author

krishnakanth

Created

2023-01-19T15:40:31.137335Z

Updated

2023-01-19T15:40:31.137335Z

#include <stdio.h>
#include <math.h>
void main ()
{
    int n,t,r,c,s=0;
    printf("Enter the number: ");
    scanf("%d",&n);
    t=n;

        while(t!=0)
        {
            r=t%10;
            c=pow(r,3);
            s=s+c;
            t=t/10;
        }

        if(s==n)
            printf("Armstrong");
        else
            printf("Not Armstrong");
}
INFO