คอมดดดดดดดดดดด
หน้า 1 จาก 1
คอมดดดดดดดดดดด
#include
main()
{
int n;
float r, pi= 3.14 , result;
printf("input radius : ");
scanf("%f",&r);
printf("Select\n");
printf("- 1 Area\n");
printf("- 2 Circum\n");
printf("Enter >> ");
scanf("%d",&n);
switch(n)
{
case 1://area
result = pi*r*r;
printf("Area = %.2f",result );
break ;
case 2://circum
result = 2*pi*r;
printf("circum = %.2f",result );
break;
default:
printf("Error!!!");
break;
}
scanf(" ");
}
main()
{
int n;
float r, pi= 3.14 , result;
printf("input radius : ");
scanf("%f",&r);
printf("Select\n");
printf("- 1 Area\n");
printf("- 2 Circum\n");
printf("Enter >> ");
scanf("%d",&n);
switch(n)
{
case 1://area
result = pi*r*r;
printf("Area = %.2f",result );
break ;
case 2://circum
result = 2*pi*r;
printf("circum = %.2f",result );
break;
default:
printf("Error!!!");
break;
}
scanf(" ");
}
Admin- Admin
- Posts : 1399
Join date : 22/05/2009
Age : 33
game
Troops: 999999999999
WW troops: 999
Population: 999
หน้า 1 จาก 1
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ