Day:
printf("\n1:Mon\t2:Tue\t3:Wed\t4:Thu\n5:Fri\t6:Sat\t7:Sun\nEnter value-> ");
scanf("%d",&x);
char dd1[5]="MON"; char dd2[5]="TUE"; char dd3[5]="WED";
char dd4[5]="THU"; char dd5[5]="FRI"; char dd6[5]="SAT";
char dd7[5]="SUN";
if(x==1){ strcpy(dd,dd1); }
if(x==2){ strcpy(dd,dd2); }
if(x==3){ strcpy(dd,dd3); }
if(x==4){ strcpy(dd,dd4); }
if(x==5){ strcpy(dd,dd5); }
if(x==6){ strcpy(dd,dd6); }
if(x==7){ strcpy(dd,dd7); } //printf("%s",dd);
if(x>7 || x<1)
{
cout<<"\nPlease Enter Valid Option\n";
goto Day ;
}
this is part of my code.....
If i given input any character it goes infinite loop...
E.g:- q
if gives int value it works fine
how to resolve it??