{
int function(int n);
int i,n=2,b;
clrscr();
for(i=0;i<100;i++)
{
b=function(i);
if(b==n)
{
printf("%d",i);
}
}
getch();
return 0;
}
int function(int n)
{
int i=0;
while(n!=0)
{
if(n&01)
{
i++;
}
n>>=1;
}
return i;
}
Output :
3
5
6
9
10
12
17
18
20
24
33
34
36
40
48
65
66
68
72
80
96