Tuesday, 19 March 2013

Introduction about C Programming


By on 01:48

The Art of Programming:-


  •             Programming is the technique of defining logic for solving a particular problem. The logic is explained by a series of statements that are usually executed one after other. 
  •             The primary objective for writing a program to achieve the desired output. The programmer should first understand what output should he/she produce and how the information should be placed in the output screen.
  •             Secondly, the programmer should identify the various inputs that are supplied for obtaining the output.
  •             Thirdly, the programmer should take into consideration the constraints or conditions, which affect the output of the program.


C Programming:-
C Programming

  •     C is a general purpose programming language and which is initially developed by Dennis Ritchie in the year of 1972 at AT& BELL laboratories. 
  •    It is a structured programming language. C is called a middle-level language( a third term which is a combination of High level and Low level language) because C possess the features of the second and third generation languages.
  • C is a highly portable language, that is, a C source program written on one computer can be compiled and executed  on a different computer with less or no modification in the source code.
  •  It can be viewed as group of building blocks called functions.
  • A function is a subroutine that may includes one or more statements designed to perform specific task. To write a C program, we first create functions and then put them together.
  • C is a powerful language. Comments in C provides easy readability.
                     The following diagram will show the overview of C Program:-


 Documentation section

  Link section

  Definition section

 Global declaration section

Main ( ) function section 
{
                    Declaration part
                    Executable part
}
 Subprogram section
{
Function_1( )
{   }
Function_2()
{  }
}

             
              A C program may contain one or more section . The following topics will give the details about the sections in the C Program.

Documentation section:- 

                
          Documentation section consists of a set of comment line giving the name of the program, the author and other details, which the programmer would like to use later.

Link section:-

         The link section will provide instructions to the compiler to link functions from the system library. The definition section defines all symbolic constants.

Global Declaration section:-

         There are some variable that are used in more than one function. Such a variable are called global variable and are declared in the global declaration section that is outside of all functions.

        This section also declares all the user defined functions.              
Main Function Section:-

        Every C program must have one main () function section. This section contains two parts. They are:

  •        Declaration part
  •        Executable part
Declaration part:-

        In the declaration part declare all the variables used in the executable part. There is at least one statement in the executable part.

         These two parts must appear between the opening  and closing brace. The closing brace of main function section is the logical end of the program. All statements in declaration and executable part end with semicolon. 

Sub program section:-

         It contains all the user-defined functions that are called in the main function. User defined functions are generally placed immediately after the main function, although they appear in any order. All sections other than main function are optional.

About Manipallavan S

Hi friends.This is Manipallavan, am doing MCA in SVCE from Chennai.This blog contains Technical,Hardware and Networking and Interview tips.This blog will clarify your queries related to Technical

1 comments: