..it will not work..
...can you make a sample program that will input an integer and displays the binary equivalent?
make a sample that will input an integer and displays the binary equivalent ?
yes sure frind please mail me details to hellopankajin@rediff.com i will mail u solution...
dec2bin(int n){if(n == 0)return ; else{dec2bin (n/2);printf("%d", n%2);}}i think now its right
#includemain(){unsigned int num;int i;scanf("%u",&num);for(i=0;i<32;i++)printf("%d",(num<<i & 1<<31)?1:0);}
..it will not work..
ReplyDelete...can you make a sample program that will input an integer and displays the binary equivalent?
ReplyDeletemake a sample that will input an integer and displays the binary equivalent ?
ReplyDeleteyes sure frind please mail me details to hellopankajin@rediff.com i will mail u solution...
ReplyDeletedec2bin(int n)
ReplyDelete{
if(n == 0)
return ; else
{
dec2bin (n/2);
printf("%d", n%2);
}
}
i think now its right
#include
ReplyDeletemain()
{
unsigned int num;
int i;
scanf("%u",&num);
for(i=0;i<32;i++)
printf("%d",(num<<i & 1<<31)?1:0);
}