Q:

'Calculating area and circumference of a circuit' program in c ... strange output

I'm working on this program that ask user to enter radius of a circuit then ask them to choose what he want to calculate: area, circumference, or volume of cylinder.. 
#include <stdio.h>

int main(void)
{
float radius=0.0,height=0.0;
char choice,quit;
const float pi=3.1415658;

do
{
printf("Enter radius : \n");
scanf("%f",&radius);

printf("\n\nWhat do you want to calc.?\nArea of circuit --> press A\n"
"Circumference of circuit --> press C\nVolume of cylinder --> press V\nQuit --> Q\n");

scanf("%c",&choice);

switch (choice)
{
case 'A':
   printf("Area = %.5f\n",radius*radius*pi);
   break;
case 'C':
   printf("Circumference = %.5f\n",2*radius*pi);
   break;
case 'V':
    printf("Enter Hight : \n");
    scanf("%f",&height);
   printf("Volume of cylinder = %.5f\n",radius*radius*pi*height);
   break;
case 'Q':
    quit='y';
   break;
default:
    printf("default!!\n");
   break;
}
}while(quit != 'y');

return 0;
}

but when I run the program 

Enter radius :
3

What do you want to calc.?
Area of circuit --> press A
Circumference of circuit --> press C
Volume of cylinder --> press V
Quit --> Q
/*here before I choose anything the next line appears, skipping reading the choice*/
default!!
Enter radius :

so why it skips reading the choice of the user and jump directly to the default ?
what's the problem ??

A:

It's because when you use scanf to read the radius, the newline you press to end that input is still in the input buffer. So when you later use scanf to read a character, it reads that newline.
The simple solution is to tell the latter scanf to skip any leading whitespace. This is done by adding a space to the scanf format code:
scanf(" %c", &choice);
/*     ^           */
/*     |           */
/* Note space here */

