HI
I need a little help with this program
#include<stdio.h>
#include<conio.h>
void main ()
{
float num1,num2,result=0;
char ch;
clrscr();
printf("\nEnter 1st num:");
scanf("%f",&num1);
printf("\nEnter 2nd num:");
scanf("%f",&num2);
wrong:
printf("\nEnter + for addition"
"\nEnter - for subtraction"
"\nEnter / for division"
"\nEnter * for multiplication\n");
scanf(" %c",&ch);
if (ch=='+')
result=num1+num2;
else
if (ch=='-')
result=num1-num2;
else
if (ch=='/')
result=num1/num2;
else
if (ch=='*')
result=num1*num2;
else
{
printf("NO MATCH FOUND");
goto wrong;
}
printf("Result=%f",result);
getch();
}
Ive used goto statement in case if wrong character is given for input and this goto statement will rerun the program till the time correct character is given as input what should i do if i want to run it only for selected number of times(in case of wrong character)????