#
__Area of a Circle__

__Area of a Circle__

*Write a program to find the area of a circle using functions.*

*
*

**Function:**

float calcarea(float x)

**Input Format:**

Input consists of 1 floating point number which corresponds to the radius of the circle.

**Output Format:**

Output consists of a single floating point number (correct to 2 decimal places). Refer sample output for

formatting details.

Take the value of pi as 3.14.

**Sample Input:**

3

**Sample Output:**

The area of the circle is 28.26

**Solution:**

**#include <stdio.h>**

float calcarea (float x);

int main()

{

int x;

float a;

scanf("%d", &x);

a = calcarea (x);

printf("The area of the circle is %.2f\n", a);

return 0;

}

float calcarea (float x)

{

float res;

res = ((x * x) * 3.14);

return res;

}

It's the best time to make some plans for the long run and it is time to be happy. I have learn this publish and if I may just I wish to counsel you some interesting things or tips. Perhaps you could write next articles referring to this article. I want to read more issues approximately it!

ReplyDeleteseo in philippines

Hi, I have recently completed a comprehensive C++ in Urdu tutorial.

ReplyDelete