Когда пользователь вводит 1,2 или 3, программа завершает работу, не сканируя количества внутри блока операторов else if.
Как сканировать внутри оператора if или else if?
if (num==4)
{
printf("exiting");
goto end;
}
else
{
if (num=='1')
{
printf("enter the value of the first unit\n");
scanf("%f",&first);
second=first*kmstomiles;
printf("the value of the second unit is %f",second);
}
else if (num=='2')
{
printf("enter the value of the first unit\n");
scanf("%f",&first);
second=first*inchestofeet;
printf("the value of the second unit is %f",second);
}
else if (num=='3')
{
printf("enter the value of the first unit\n");
scanf("%f",&first);
second=first*cmtoinches;
printf("the value of the second unit is %f",second);
}