Sunday, August 12, 2012

Strong Number program using C language


#include<conio.H>
#include<stdio.h>
void main()
{
int i,k,t,x,r,s=0;
clrscr();
printf("\n Enter any number");
scanf("%d",&x);
t=x;
while(x>0)
{
k=1;
r=x%10;
for(i=1;i<=r;i++)
{
k=k*i;
}
s=s+k;
x=x/10;
}
if(t==s)
{
printf("\n %d is a strong number",t);
}
else
{
printf("\n %d is not a strong number",t);
}
getch();
}

No comments:

Post a Comment

DC motor control with Pulse Width Modulation Part 1

DC Motor intro DC motor is a device which converts electrical energy into kinetic energy. It converts the DC power into movement. The typica...