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. They are useful to write better and complex program. Control S

Beginner our view on C programming Language

  Beginner our view on C programming Language   Beginner ourview on C programming Language History about C programming Language. The founder or we can say developer of C programming language was Dennis Ritchie. He was found in  Bell labs USA. The Birth of C language is originally on 1972. After the time C is widely popular all around the world. C is also used in to develop many OS system some are Linux and Windows. Now days C is still widely used or popular language in Programming world. Here, we have a question is What is a Program ?  A Program is a set of instruction which on   execution by a machine produces a specific result. A machine needs set of instructions to perform an operation. Those set of instruction are contained in a program. What is program? What is Programming languages ? What Is a Programming Languages? Meaning- A programming language allows a programmer to develop instructions which can be executed by a machine. A programming language acts as an intermediate bet

Whatsapp chats and Status tricks 2021

whatsapp chatting and status trick Today we will talk about some secret options of WhatsApp which you should know. We will talk about how we can see someone's Whatsapp status without anyone knowing it. And at the same time, we will also talk about how to see someone's message, without getting blue ticked in his phone. To know about all this, read this entire article carefully.  1.  Let's know about Whatsapp In the whole world, whatsapp is the only messenger application to be used the most. WhatsApp is a free application that anyone can use for absolutely free. We do not see any advertisement like other social media applications, meaning It does not earn any money from its own app. WhatsApp was created by Brian Acton and Jan Koum in 2009. After 2014 facebook bought whatsapp, since then it is now owned by facebook. WhatsApp is now controlled and maintained by facebook. As you may know, Facebook is a multinational company. There are many products of Facebook which we use every