4. WAP for signed character input.
#include<stdio.h>
void printbits(int value);
void main()
{
char ch =225;
printf("%d\n",ch);
printbits(ch);
}
void printbits(int value)
{
for(int i =16;i>=0;i--)
printf("%d",(value>>i)&1);
printf("\n");
}
Comments
Post a Comment