我不明白我哪里出错了。它不会在第二次读取,scanf()
只是跳到下一行。
#include <stdio.h>
#define PI 3.14
int main()
{
int y='y', choice,radius;
char read_y;
float area, circum;
do_again:
printf("Enter the radius for the circle to calculate area and circumfrence \n");
scanf("%d",&radius);
area = (float)radius*(float)radius*PI;
circum = 2*(float)radius*PI;
printf("The radius of the circle is %d for which the area is %8.4f and circumfrence is %8.4f \n", radius, area, circum);
printf("Please enter 'y' if you want to do another calculation\n");
scanf ("%c",&read_y);
choice=read_y;
if (choice==y)
goto do_again;
else
printf("good bye");
return 0;
}