#include <stdio.h> int main(int argc,char *argv[]) { int a,i; int b,c,d,e; printf("Please input int for a :\n"); scanf("%d",&a); c=a&0x000000ff; b=a&0x0000ff00; d=a&0x00ff0000; e=a&0xff000000; b=b>>8; d=d>>16; e=e>>24; printf("\na= 0x%.2X 0x%.2X 0x%.2X 0x%.2X",e,d,b,c); printf("\na= "); for(i=0;i<32;i++) { if((a<<i)&0x80000000) printf("1"); else printf("0"); } printf("\n"); printf("\na= 0x%X a=%d",a,a); printf("\n"); return 0; }