code help

why does this code present me the menu twice everytime i chose an option? i think it has something to do with the while loop.

#include <stdio.h>
void main(){
char choice;
int enter =1;
while(enter ==1){
printf("choose from options\n");
printf("a do something\n");
printf("b do something else\n");
printf("c quit\n");

   choice = getchar\(\);
   switch\(choice\)\{
       case 'a':
              printf\("apply a"\);
              break;
       case 'b':
              printf\("apply b"\);
              break;
       case 'c':
               enter=0;
               break;
        default:
              printf\("something"\);
              
    \}   

}
}

What help do u need???

sorry. everytime i run this code, enter an option, the menu of options always display twice before i could choose the option again. for some reason, the first time through it doesn't let me enter an option, like it totally disregard the getchar() statement. it go to the dafault case, and start over the loop, and then it let me enter an option.

That is because the last time you made a choice and hit [ENTER], the [ENTER] key was also stored in the input buffer along with your choice. And this [ENTER] key code was retrieved the next time you called getchar(). To avoid this, replace your getchar() line with:

while((ch = getchar()) != '\n');