i am working on homework for my programming class which uses C. i have to make a program that calculates some simple geometry. the user chooses which shape to make calculations on. i am using a switch statement but when i try to break, it comes up as illlegal break when i compile. can anyone help? this is just part of the program
Code:
switch(shape)
case 1:
printf("Enter the radius of a circle(9999 to quit):\n");
scanf("%lf", &radius);
while(radius != 9999){
while(radius < 0){
printf("Invalid input!\n");
printf("Enter the radius of a circle(9999 to quit):\n");
scanf("%lf", &radius);
}
area = radius * radius * PI;
circumference = 2 * radius * PI;
printf("The area of the circle is %.2lf\nThe circumference of the circle is %.2lf\n", area, circumference);
printf("Enter the radius of a circle(9999 to quit):\n");
scanf("%lf", &radius);
}
break;
case 2: