I am trying to convert an int, a char, and a short into their binary values and display it.
int a;
char b;
short c;
I understand how to convert an integer to a binary value bit by bit, I just don't understand how to store it as a varible so I can print it out as a binary value in a printf() line.
do{
int temp = a%2; //the value of the bit starting at the least significant
a = a/2;
//how would i store this bit by bit
}while(a>0);