#include <stdio.h>
#include <stdlib.h>
int main(void){
int dato;
unsigned char byte3, byte2, byte1, byte0;
printf("Ingrese un numero: ");
scanf("%d", &dato);
/*Inserte su codigo aqui*/
byte0=dato&(0xff);
byte1=(dato>>8)&(0xff);
byte2=(dato>>16)&(0xff);
byte3=(dato>>24)&(0xff);
printf("El numero es %#x\n", dato);
printf("Sus bytes son %#x %#x %#x %#x\n", byte3, byte2, byte1, byte0);
system("pause");
return 0;
}
No hay comentarios:
Publicar un comentario