Computer Courses

[Computer Courses][bleft]

Article, Tips & Tricks

[Other Material][bsummary]

Our Courses

[Our Courses][grids]

Blog

[Blog][twocolumns]
[Accounting Courses][feat1]

The picture speaks for itself

[Gallery][feat1]

Notice

[Notice][grids]

OVERVIEW OF "C" PROGRAMMING (PART-I)

C language is one of the most popular computer languages today because it is a structured, high level, machine independent language. It allows software developers to develop programs without worrying about the hardware platforms where they will be implemented. C is called a high level, compiler language. The aim of any high-level computer language is to provide an easy and natural way of giving a programmer of instructions to a computer.

C is one of a large number of high-level languages which can be used for general purpose programming, i.e., anything from writing small programs for personal amusement to writing complex applications. It is unusual in several ways. Before C, high-level languages were criticized by machine code programmers because they shielded the user from the working details of the computer. The C language has been equipped with features that allow programs to be organized in an easy and logical way. This is vitally important for writing lengthy programs because complex problems are only manageable with a clear organization and program structure.


C allows meaningful variable names and meaningful function names to be used in programs without any loss of efficiency and it gives a complete freedom of style, it has a set of very flexible loop constructions and neat ways of making decisions. These provide an excellent basis for controlling the flow of programs. Another feature of C is the way it can express ideas concisely. The richness of a language shapes what it can talk about. C gives us the apparatus to build neat and compact programs. C tries to make the best of a computer by linking as closely as possible to the local environment. The increasing popularity of C is probably due to its many desirable qualities. It is a robust language whose rich set of built-in functions and operators can be used to write any complex program. The C compiler combines the capabilities of an assembly language with the features of a high-level language and therefore it is well suited for writing both system software and business packages. Programs written in C are efficient and fast. This is due to its variety of data types and powerful operators. C is highly portable. This means that C programs written for one computer can be run on another with little or no modification. Another feature of C is its ability to extend itself.

INTRODUCTION
C is a remarkable language. Designed originally by Dennis Ritchie, working at AT&T Bell Laboratories in New Jersey, it has increased in use until now it may well be one of the most widely-written computer languages in the world. C is a structured language. It allows a variety of programs in small modules. It is easy for debugging,  testing, and maintenance if a language is a  structured one.

STRUCTURE OF A C PROGRA
Include header file section
Global declaration section
main()
{
Declaration part
Executable part
}
User-defined functions
{
Statements
}

Include Header File Section
C program depends upon some header files for function definition that are used in the program. Each header file by default is extended with .h. The header file should be included using # include directive as given here.
Global Declaration
This section declares some variables that are used in more than one function. These variables are known as global variables. This section must be declared outside of all the functions.
Function Main
Every program written in C language must contain main () function. The function main() is a starting point of every C program. The execution of the program always begins with the function main ().
Declaration Part
The  declaration  part  declares  the  entire  variables  that  are  used  in  executable  part.  The initializations of variables are also done in this section. Initialization means providing an initial value to the variables
Executable Part
This part contains the statements following the declaration of the variables. This part contains a set of statements or a single statement. These statements are enclosed between the braces.
User Defined Function
The functions defined by the user are called user-defined functions. These functions are generally defined after the main () function

STEPS FOR EXECUTING THE PROGRAM
A)  Creation of program
Programs should be written in C editor. The file name does not necessarily include extension C. The default extension is C. B)    Compilation of a program
The source program statements should be translated into object programs which is suitable for execution by the computer. The translation is done after correcting each statement.  If there  is  no  error,  compilation  proceeds  and  translated  program  are  stored  in  another  file with the same file name with extension “.obj”. C)    Execution of the program
After  the  compilation  the  executable  object  code  will  be  loaded  in  the  computers  main memory and the program is executed.

C CHARACTER SET




DELIMITER



C KEYWORD