C Program to Condense a number
#include
#include
void cn(int n)
{
int i=0,c=0,r=0;
while(n!=0)
{
i++;
r=n%10;
c=c+r;
n=n/10;
}
if(i>1)
cn(c);
else
printf("\n Condensed Number : %d",c);
}
void main()
{
int num,c;
clrscr();
printf("\n Enter Number: ");
scanf("%d",&num);
cn(num);
getch();
}
**************** OUTPUT ********************
Enter Number: 98
Condensed Number: 8
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 Condense a number
Posted by ars at 12:04 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment