hello everyone!

i am new here and i have a question.
i wrote a program in c that get a char and 2 numbers and with the char the user entered the program does some actions.
Q is for quitting the program
its all working nice to here, the problem is after i entered the while loop once and entered some inputs i get the result, but then when it comes back to the while loop its shows me the printf give me an error and shows the printf again and after that its ready to get an input.
i tried to debug and for some reason the Variable "c" get a value of "/n" when it comes to the while loop in the second time, and i dont understand why.


i uploaded a picture that shows the problem and added the code.
someone sees the problem?

Thanks.

Code:
#include <stdio.h>
#include <conio.h>
#include <math.h>

int main()
{
	int num1,num2;
	int sum,check,min,max,p;
	int gcd,i;
	char c;
	clrscr();
   while(c!='Q')
	{
	 num2=0;
	 num1=0;
	printf("\nEnter action (Q to quit), and two numbers by that order:");
	scanf("%c", &c);
	switch(c)
	{
		case 'a':
			scanf("%d%d",&num1, &num2);
			sum=(num1+num2);
			check=sum%2;
			if (check!=0)
				printf("\nThe average is not a whole number");
			else
				printf("\nThe average is a whole number");
			printf("\n\nThe average is: %.2f", ((float)(num1+num2)/2));
		break;
		case '*':
			scanf("%d%d",&num1, &num2);
			printf("\nThe product is: %d", num1*num2);
		break;
		case 'm':
			scanf("%d%d",&num1, &num2);
			min=(num1<num2)? num1:num2;
			printf("The smaller number is: %d", min);
		break;
		case 'M':
			scanf("%d%d",&num1, &num2);
			max=(num1>num2)? num1:num2;
			printf("The larger number is: %d", max);
		break;
		case 'g':
		{
			 scanf("%d%d", &num1, &num2);
			 if(num1<num2)
			 
			 for(i=1;i<=num1;i++)
			 {
				 if(num1%i==0&&num2%i==0)
					 gcd=i;
			 }
			 else
			 {
				 for(i=1;i<=num2;i++)
				 { 
					 if(num1%i==0&&num2%i==0)
						 gcd=i;
				 }
			 }	
			 
				 printf("\GCD: %d", gcd);
			 
		 break;
		 case 'Q':
		  printf("\nProgram Terminated.");
		 break;
		 case '^':
		  scanf("%d%d", &num1, &num2);
		  p=pow(num1,num2);
		  printf("\nThe result of %d^%d is: %d", num1, num2 , p);
		 break;
		 }
		 default: printf("\nERROR");
		 break;
	}
}
   getch();
   return 0;
}