Shopping In MUMBAI

Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top. Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.

Wednesday, December 31, 2008

C Program to check whether the number is Armstrong no or not

C Program to check whether the number is Armstrong no or not

#include
#include
#include
void main()
{
int num,a,p,count=0,s=0,b,c;
clrscr();
printf("Enter the number\n");
scanf("%d",&num);
b=num;
p=num;
while(num!=0)
{
a=num%10;
count++;
num=num/10;
}
while(b!=0)
{
c=b%10;
b=b/10;
s=s+pow(c,count);
}
printf("\nNo of digits:%d",count);
printf("\nPower of number of digits:%d",s);
if(s==p)
printf("\nArmstrong number");
else
printf("\nNot an armstrong number");
getch();
}




****************OUTPUT*************
Enter the number
153

No of digits:3
Power of number of digits:153
Armstrong number

C Program to check whether the number is Armstrong no or notSocialTwist Tell-a-Friend

0 comments:

SUPPORT THIS BLOG