Can't get this to work properly. Output is at the bottom of what i am getting if i try to type either "p" or "s"
Code:
void menu(void)
{
char selection[30];
fflush(stdin);
puts("\nPlease select one of the following:");
printf("\n\np = Parallel Resistance");
printf("\ns = Series Resistance");
printf("\n\n>");
scanf("%c", &selection);
if (selection =='p')
parallel();
else if (selection =='s')
series();
else
{
printf("\nInvalid selection. Press any key to exit, then relaunch the program");
}
}
/*
This program will calculate either PARALLEL RESISTANCE
or SERIES RESISTANCE using 2 specified resistor values
Please select one of the following
p = Parallel Resistance
s = Series Resistance
>p
Invalid selection. Press any key to exit, then relaunch the program
*/