Program to check whether the given number is Armsoring number or not

sum of cubes of given number is equal to the actual number.

#include<stdio.h>
#include<conio.h>
main (  )                                 
{
int n, s = 0, a, r,n;
printf (“enter a number “);
scanf(“%d”,&n);       
a= n;
while (n!=0)
{
r = n% 10;
s = s + r *r*r;
n=n/10;
}
if (a==s)
printf (“armstrong number”);
else
printf (“not an armstrong number”);
getch();
}

Out Put:
 enter a no 153
Armstrong number
Enter a no 67
Not an arm strong number

Related

write a program for printing Floyd's triangle

# include<stdio.h> #include<conio.h> void main ( ) { int i, j,k=1; for ( i = 1; i < = 4 ; i ++) { for ( j =1; j < = i; j ++) {  printf("%d\t",k);  k++; } pr...

write a program for printing the following number format

# include<stdio.h> #include<conio.h> void main ( ) { int i, j; for ( i = 1; i < = 4 ; i ++) { for ( j =1; j < = i; j ++) {  printf("%d\t",j); } printf (“\n”); } ...

Write a program for printing the following number format

# include<stdio.h> #include<conio.h> void main ( ) { int i, j; for ( i = 1; i < = 4 ; i ++) { for ( j =1; j < = i; j ++) {  printf("%d\t",i); } printf (“\n”); } ...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item