yea, and what was my programm doing? exactly it should do this but it wasnt working thats why I came here
Now I wrote it with just one loop but it shows just nothing...
Code:
#include <stdio.h>
void main ()
{
unsigned short int number; //Typed Number
unsigned short int b = 0x8000; // Mask
int i = 0;
printf ("Pleae type a postive number: ");
scanf ("%d", &number);
// Number = 0 = 0000.0000.0000.0000
if ( number == 0 )
{ printf ("\nResult: 0000.0000.0000.0000");
}
else if ( number != 0 )
{
while ( i < 16 )
{
i = i + 1;
if ( number & b != 0)
{ printf ("1");
b = b >> 1;
number = number >> 1;
}
else if ( number & b == 0)
{
printf ("0");
b = b >> 1;
}
}
}
getchar ();
getchar ();
}