Hi guys hope you doing fine, so i am new at C programming with eclipse. The problem is in working with eclipse is that it's not showing outputs. Hope guys you can help me and thank you. here's the code:
#include <stdio.h>
int main()
{
float result;
int choice;
printf("Press 1 to calculate area of circle\n");
printf("Press 2 to calculate area of square\n");
printf("Press 3 to calculate area of sphere\n");
printf("Enter your choice:\n");
scanf("%d",&choice);
switch (choice) {
case 1: {
printf("Enter radius:\n");
result = 3.14 * 4;
printf("Area of sphere=%f",result);
break;
}
case 2: {
printf("Enter side of square:\n");
result = 4;
printf("Area of square=%f",result);
break;
}
case 3: {
printf("Enter radius:\n");
result = 4 * (3.14 * 4);
printf("Area of sphere=%f",result);
break;
}
default:
printf("wrong Input\n");
}
return 0;
}