Skip to main content

Structure Of C Language Program Btech BCA Notes

 

Structure Of C Language Program Btech BCA Notes




Before begin with topic I will share some important term and sequence of coding in c programming language. Without them code of C is useless and nothing without them. So, they are stdio.h and conio.h header files.

What is Stdio.h Header file In C Programming?

Stdio.h means Standard input output, which manages the fundamental operations required to run a program. Example is creation of variables assigning them memory etc.

What is conio.h Header file In C Programming?

Conio.h means console input output, which handles the entire input output operation during the course of execution of the program.

you may also like our previous post, first post of C language Beginner our view on C programming Language  also read it.

What is the Structure of C language program?


What is the Structure of C language program?


Generally there are five structure of c language program. We use them in every program, Without the structure of program there is nothing because structure give a way of write a program how to write and where we write. It provide kind of path to write a good and running program without any error. So, there structure of C language program are:-

1). Documentation Section

2). Pre-processor Directive Section

3). Global Declaration Section

4). Main Section

5). Sub-program Section

1). Documentation Section In C Language

The first section in a structure of a C-language program is documentation section or commenting Section. Where we specific/provide information about the source code. This section is an optional section makes a program more efficient and scalable.

To provide information, we can either use single line comment (//) or Multiline comment (/* ……. /). Simply we can say here in documentation section we can tell some one about our program via creating title in form of commenting.

2). Pre-processor Directive Section In C Language

Pre-processor directive section is a mandatory Section/Compulsory Section in a structure of C-Language program. In this section we specify the name of header files which are needed to run these source code. Header files are included using a pre-processor directive ( #include ).

Syntax:- #include<name of header file.h>

To include a user defined header file, we use the following syntax.

In this Section, we can also define a macro. Macro is used to create constant or a block of code similar to a function.

Syntax:- #define MACRO NAME value

3). Global Declaration Section In C Language

Global declaration Section is an optional section in which variables with global effect/scope are created. Variables created in this section can be used through out the program or through out the project. Variables created in this section remains in the memory through out the lifetime of the program.

Data type variable name; ( data types:- int, char, float, long etc.)

4). Main Section In C Language

Main Section is the most important part of any C Language program. The code related to the problem to be solved is specified inside main section/function. The execution of the program starts from main section.

Void main()

{


//code to be executed


}

Main is function from where execution starts. Main is called automatically. This section is compulsory in C program.

5). Sub-program Section In C Language

In C Language program, we can create a block of code which can be executed any number of times as and when required. Such a block of code is called a Sub-program or a function. A Sub-program helps in achieving code reusability.

Syntax:-      

returntype name of the function()

{


code


}

Some important lines to Remembering in C Programming Turbo c/c++

* Compiler:- Whenever we compile a code the code is checked by the compiler, If their is no error, Then the code is converted into the format which is understand by the machine. This process is called Compilation.

* Write the code and save in turbo = .c

* Compile the code in turbo = Alt+F9

* Run the code in turbo = Ctrl+F9

* copy code in turbo = Cltr+Insert

* Paste code in turbo = Shift+Insert

* Cut lines = shift+Delete

* Go back during run a code = tc.exe

* Close the application = Alt+X


We will going on series of C Programming language of all topics. So, you can follow us for more updates.

Comments

Popular posts from this blog

Control Statements in c language

So, Today we are going on new topic name control statements in C language. In which we read Looping(For, While and Do While), Jumping(Break, goto and Continue) and Decision Control statements(Switch, If, If Else and  If else if ladder)  in C. Before you read this article May you also like our previous posts :-    Structure Of C Language Program   Variables & Datatypes In C Language    Format Specifier In C Programming  .   It may help you to understanding it. A Statement is the smallest unit that is a complete instruction in itself statements contains expression and usually end with a semicolon. Statements are of two Types:- Types of Statements in C  1. Sequential Statement   2. Control Statement Sequential Statements are statements which are executed by one in sequential manner. Control Statements are the statements which alter the flow of execution and provide better control to the programme. On the flow of execution. The...

Array in C Language Btech Bca Notes

 Array in C Language Btech Bca Notes An array is a data form that can hold several values all of the same type. An array is a collection of variable of the same type that are referral to by a common name. Also Read:   Beginner our view on C programming Language  . Array are vital for most programming language. They are collection of variables, which we call elements. Each of the element in an array is stored sequentially in the computeric memory.  This making it easy to  m anipulate them and navigate among them. Since all the elements in an array are of same type, array allows us to represent a group of similar elements as an ordered  sequence  and work on them as a whole (grouping together related data). Array organize data in such a way that it can be easily sorted. To create an array, we use a declaration statement. An array declaration should indicate three things: 1. The type of value to be stored in each element. 2. The name of the array. 3. The ...

Format Specifier In C Programming Btech BCA Notes

   Format Specifier In C Programming Btech BCA Notes Welcome, Hope you are doing well. Today we are talking about Foramat specifier in C language. We can also say Type Specifier In C.  So, Today we are read formate specifier as well as printf and scanf Formats in different situations and different conditions. Before you read this article May you also like our previous posts :-    Beginner our view on C programming Language     Structure Of C Language Program   Variables & Datatypes In C Language  . It may help you to boost Your Information. In C Programming language, Types specifier is a special piece of code which is used during the input and output. Type specifier inform the compiler about the type of data which will be entered or displayed during an input output operation. Input mans reading data from keyword while output means displaying data either on screen or a printer. In c – Language every datatype has its own type specifier...