#include <stdio.h>
#define PI 3.14159 // ค่าคงที่ของ π (Pi)
int main( ) {
float radius; // รัศมีของวงกลม
float area; // พื้นที่ของวงกลม
printf ( "Enter the radius of the circle: " ) ;
area = PI * radius * radius; // สูตรพื้นที่วงกลม
// แสดงผลพื้นที่ด้วยทศนิยม 2, 3, และ 4 ตำแหน่ง
printf ( "Area of the circle (2 decimal places): %.2f\n " , area
) ; printf ( "Area of the circle (3 decimal places): %.3f\n " , area
) ; printf ( "Area of the circle (4 decimal places): %.4f\n " , area
) ;
return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNkZWZpbmUgUEkgMy4xNDE1OSAvLyDguITguYjguLLguITguIfguJfguLXguYjguILguK3guIcgz4AgKFBpKQoKaW50IG1haW4oKSB7CiAgICBmbG9hdCByYWRpdXM7IC8vIOC4o+C4seC4qOC4oeC4teC4guC4reC4h+C4p+C4h+C4geC4peC4oQogICAgZmxvYXQgYXJlYTsgICAvLyDguJ7guLfguYnguJnguJfguLXguYjguILguK3guIfguKfguIfguIHguKXguKEKCiAgICBwcmludGYoIkVudGVyIHRoZSByYWRpdXMgb2YgdGhlIGNpcmNsZTogIik7CiAgICBzY2FuZigiJWYiLCAmcmFkaXVzKTsKCiAgICBhcmVhID0gUEkgKiByYWRpdXMgKiByYWRpdXM7IC8vIOC4quC4ueC4leC4o+C4nuC4t+C5ieC4meC4l+C4teC5iOC4p+C4h+C4geC4peC4oQoKICAgIC8vIOC5geC4quC4lOC4h+C4nOC4peC4nuC4t+C5ieC4meC4l+C4teC5iOC4lOC5ieC4p+C4ouC4l+C4qOC4meC4tOC4ouC4oSAyLCAzLCDguYHguKXguLAgNCDguJXguLPguYHguKvguJnguYjguIcKICAgIHByaW50ZigiQXJlYSBvZiB0aGUgY2lyY2xlICgyIGRlY2ltYWwgcGxhY2VzKTogJS4yZlxuIiwgYXJlYSk7CiAgICBwcmludGYoIkFyZWEgb2YgdGhlIGNpcmNsZSAoMyBkZWNpbWFsIHBsYWNlcyk6ICUuM2ZcbiIsIGFyZWEpOwogICAgcHJpbnRmKCJBcmVhIG9mIHRoZSBjaXJjbGUgKDQgZGVjaW1hbCBwbGFjZXMpOiAlLjRmXG4iLCBhcmVhKTsKCiAgICByZXR1cm4gMDsKfQo=