structure of C - C tutorials

                              Structure  of  C 

Structure of C
                       structure of C..

In this section I am clearing concept about structure of C program..

All c programs have to follow  these steps :

A  c starts with main function and executes instruction inside it.

Each instruction is terminated with semicolon ..(;).

💥Rules applicable to all C programs ::-

1. every program exeution starts from main ()  function..

2. All statements terminated with semicolon.

3. Instruction are case sensitive.

4. Instruction executed in same order which they are written.


Structure of C programming language is basically divided into three to four parts...

1. Comment line.

2. main function.

3. preprocessor directive.

4. Global variable declaration.

1. Comment line :-

 It helps to show main aim of program. It is useful to explaining to  program in details for documentation. It is indicated by /*.............*/    to increase readability of program. It is symboled within decimeters  With the exception of character and string constants, it may appear anywhere in the program. A comment line may have one or more lines, but they must not be nested.

2.main function :-

main() It is a user-defined function, and each function includes a main() function that serves as the real launch point for the program. This function is enclosed in a pair of curly brackets. The main() function can be located anywhere in the program, although in practise it is usually put in the beginning.
Syntax:  

main() {                                                                                                                        ......                                                                                                                ......                                                                                                                ......

            }

When void (which refers to null or empty), as in void main(void) or void main, the main function does not return any value ()

 3. Preprocessor Directive :-

The compiler is instructed to include information about the standard input/output library via the command #include<stdio.h>.
Additionally, it is utilized in symbolic constants like #define PI 3.14. (value).
The definition and declaration of system specified functions like printf(), scanf(), and pow() are contained in the stdio.h (standard input output header file). In general, the functions printf() and scanf() are used to show and read values, respectively.

4. Global variable Declaration :-

Global variables are declared in this portion of the program so that they can be accessed by all of the functions that use them.
And typically, it is defined outside of the function.


 

Structure of C
                                      structure of C



 

 

#programmers

No comments

This website is only for educational purpose, it is not related to any organization. This website helps to beginners in programming to learn fast.

Powered by Blogger.