Lets understand the basic structure of a C program. A C program is divided into different sections. There are six main sections to a basic c program. The six sections are, Documentation Include/Link/Preprocessor section Definition Global Declarations ( Functions and variables) Main function Subprogram functions Now let us learn about each of this layer in detail. Figure: Basic Structure Of C Program Sample Program The C program here will find the area of a circle using a user-defined function and a global variable PI holding the value of pi /* File Name: areaofcircle.c Author: Abhijith date: 06/05/2021 description: a program to calculate area of circle user enters the radius */ #include<stdio.h> //link section #define PI 3.14;//definition section float area(float r);//global declaration /****************************/ int main()//main function { float r; printf(" Enter the radius:\n"); scanf("%
EST 102 Programming in C Theory and Lab-KTU FIRST YEAR 2019 scheme - Dr.Binu V P, 9847390760