hello.c 274 B

123456789101112
  1. #include <stdio.h>
  2. #define PI (3.1415926)
  3. /* 计算圆的周长:
  4. 给定半径,计算并输出圆的周长 */
  5. int main(int argc, char** argv)
  6. {
  7. float radius = 5.0f;
  8. float perimeter = 2 * PI * radius;
  9. printf("Perimeter is: %f \n",perimeter);
  10. return 0;
  11. }