I'm aure it's a simple and foolish mistake that I'm making, here, likely as a result of some error that I never should have made, but I can't quite figure out how to get this to work properly....
The program is a simple converter for decimal to hex that allows users to choose when to exit (cia a simple "Continue? Y/N"-style continuation). Now, It will certainly allow a user to perform multiple conversions by typing "Y" at the prompt; however, exit does not work through the conventional means expected. Any help with this admittedly basic issue would be greatly appreciated.
Code:
#include <stdio.h>
int conv;
char conf;
void convert()
{
printf("\nNumber to be converted: ");
scanf("%d", &conv);
getchar();
printf("\nResult: %x", conv);
printf("\nConvert another number? Y/N ");
scanf ("%c", &conf);
getchar();
}
int main()
{
printf("Decimal to Hexadecimal Conversion\n");
do {
convert();
}
while (conf == 'y' || 'Y');
return 0;
}