You are on page 1of 1

1: /* Documentation Section */

2: /* Program to find area & circumference of circle */


3: /* Developer: G. Mohnish Date: 01 - 08 - 2023 */
4:
5: /* Link Section */
6: #include <stdio.h>
7: #include <iostream>
8:
9: /* Define Section */
10: #define PI 22.0/7.0 /* Correct value for PI */
11:
12: /* Global Declaration Section */
13: int a = 0; /* Global Declaration Variable */
14: void show(); /* Declaration Of User-Defined Function */
15:
16: /* Main Function Section */
17: int main()
18: {
19: float r, area = 0, circum = 0; /* Declaration Part */
20: /* r for radius, circum for circumference */
21:
22: /* Executable Part */
23: printf("Enter radius value to find Area & Circumference: ");
24: scanf("%f", &r); /* Corrected the format specifier */
25:
26: area = PI * r * r;
27: circum = 2 * PI * r;
28:
29: printf("Area of Circle = %f\n", area); /* Corrected the format specifier and variables *
30: printf("Circumference of Circle = %f\n", circum);
31:
32: printf("Global variable 'a' in main = %d\n", a);
33: show(); /* Main Calls Show Function */
34: return 0; /* Added return statement */
35: }
36:
37: /* User-Defined Function Section */
38: void show() /* Show Function Definition */
39: {
40: printf("show is a User-Defined Function\n");
41: printf("Global variable 'a' in show function = %d\n", a);
42: }
43:

You might also like