I am trying to write a program using unsigned char, that prompts the user to enter a two-digit hex value, then displays the value. Can anyone point me in the right direction? Thanks This is what I have so far.swapnibbles.c Also.
Code:
#include <stdio.h>
unsigned char swapnibbles(unsigned char data)
{
if
((data < 0x00) || (data > 0xFF) )
printf ("\nInvalid Entry\n");
}
unsigned char data (void)
{
unsigned char data;
scanf ("%0x", &data);
printf ("0x", data);
return data;
}
char main (void)
{
data ();
return 0;
}