number is armstrong or not

//to check number is armstong or not without arguement and without retern type
#include<stdio.h>
#include<conio.h>
void input();
void process();
int i,j,r,sum,no,temp;
void main()
{
clrscr();
input();
getch();
}
void input()
{
printf(“enter your no”);
scanf(“%d”,&no);
process();
}
void process()
{
for(i=1;i<=no;i++,temp=i)
{
for(j=i;j>0;j=j/10)
{
r=j%10;
sum=sum+(r*r*r);
}
if(temp==sum)
printf(“%d”,temp);
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *