Basic Structure of c program

1.Header file [#include<stdio.h> , conio.h , math.h , string.h]

#incluide<stdio.h:-

👉 This command is a preprocessor directive in c which contain all standard input and output files before compile any c program.

2.Global variable
3.main()
4.{
5.Local variable
6.Body/Statement
7.}

Basic Structure of c program

❶ Header file

👉 This is a collection of files that contains many functions.

✪ Stdio.h

👉 This also known as Standard input output header file.

👉 It contain two function file

A. Printf()

B. Scanf()

❖What is input and output function:-

👉 When we want to create a program then we need to a function that provides to inter the data into its environment after compulsion of this program we want to display their effect on the screen such as monitor.

✬For this work c compiler provides two types of function.

A. Printf():-

👉 Printf() is used to display/print value of variable using standard output device

printf(“format specifier”,variable name);

EX:-Int a,b

printf( “%d%d”,a,b);

2. EX:- Name print:-

Printf(“message”);

Printf(“csestudy247.com);

B. Scanf():-

👉 This is a library function which is used to enter data from standard input device.

scanf(“format specifier”,& variable name);

ex:-Int a,b

scanf(“%d%d”,&a,&b);

✪ conio.h

👉 This also known as consol input output header file.

👉 It contain Two function file

A. getch()

It is used to hold the output screen.

EX:-ATM Machine :-like 1st inset ATM card and select the language and enter the password here ATM screen hold whenever you can not press the cancel button.

2.Turbo c++ compiler like same as ATM Machine

B. Clrscr()

It is used to clean output screen.

EX:-Turbo c++

✪ Math.h

👉 This also known as mathematical header file.

👉 It contain many function file.

A. Pow()

B. sqrt()

C. asin()

D. acos()

E. log()

F. exp() etc

✪ String.h

👉 This also known as string header file.

👉 It contain many function.

A. strcpy()

B. Strlen()

C. Strchr()

D.Strlwr()

Basic structure of c program

❷ Global variable

👉 Such a variable in which is define outside the main() function is called as global variable.

❸main():-

👉 This is a function at which any program is start to work and in other word any program has execute/Run main() function.

❹{

👉 This is use to open the function.

❺Local variable:-

👉 Such a variable which is define inside the main() function is known as local variable.

❻Statement/Body

👉 All processing work is written in this part.

❼ }

👉 This is used to close/end the function.