dhruv.ydv
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
main()
{
int a[10], range, rem=0,quot =0, i;
printf("\n What range you want ? : ");
scanf("%d",&range);
bzero(a,10*sizeof(int));
a[0] =1;
while(range)
{
if(range < 10)
{
rem = range%10;
a[rem] +=1;
range--;
}
else
{
quot = range/10;
a[quot] +=1;
rem = range%10;
a[rem] +=1;
range--;
}
}
printf("\n");
for(i=0; i < 10; i++)
printf("Num of %ds %d\n", i,a[i]);
}
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
And you may traverse via the head->right and so on.
- dhruv.ydv April 18, 2014