#include
void generatebits(int num)
{
int temp;
if(num!=0)
{
temp = num % 2;
generatebits(num >>= 1);
printf("%d",temp);
}
}
int main()
{
int num;
printf("\nEnter a number\n");
scanf("%d", &num);
printf("\n\n");
generatebits(num);
return(0);
}
No comments:
Post a Comment