Calculate Circumference of Circle - C

Circle Circumference

Snippet Code


  
Rate this page :
  [ 0 votes]

#include <stdio.h> #define PI 3.14159 int main(void) { float area , circumference , radius; printf(<q>What is the radius of the circle.n</q>); scanf(<q>%f</q>,ampradius); area = PI * radius * radius; circumference = 2.0 * PI * radius; printf(<q>The circumference of the circle is %1.2f.n</q>,circumference); printf(<q>The area of the circle is %1.2f.n</q>,area); return 0; } Output: What is the radius of the circle 4 The circumference of the circle is 25.12

Tags


Ask Questions

Ask Question