This is your program with a few wrinkles. It runs fine, but you have NO logic to change the float, or the integer, into a hexadecimal number.
printf("Enter the Decimal number to be converted:\n");
printf("The float number in base 10 is: %f, and in Hexadecimal is: %x\n", myUnion.b, myUnion.a);
printf("%d",(int) myUnion.b); //NOTE the cast to an int
while((myUnion.a = getchar()) != '\n'); //these two lines work to hold the console window open
myUnion.a = getchar();