Header Ads

ad728
  • Breaking News

    C Language Introduction


    C language Introduction. Before learning the introduction of c we remember some interesting concepts. We all are well known about the alphabets for the reading ,writing, communication purpose.Same way we know about numbers for calculations in our daily usages right. You want to speak something first you know the language then you know the concept of your topic.
    In the same way as my knowledge if you want became a programmer you must and should start learning with c language only. If you choose any plat form or any language all the features of all languages are derived from the c language only. For this reason if you learn perfectly c language you can learn easily other programming languages CPP ,JAVA, DOT NET, .etc.

    WHAT IS A LANGUAGE

    Language is a Communication media between two persons are two things. Like if we both are talking with each other by using some English language.In the same we can communicate person to computers, person to mobile phones, computers to computers by their understandable languages.

    WHAT IS A PROGRAM

    program is nothing but set of instructions. Here in programming way instruction is nothing but collection of OPERATOR and OPERAND EX: C=a+b. a,b,c are operators and +, = are operands.

    WHAT IS AN ALGORITHM

    STEP BY STEP PROCEDURE of given task is known as algorithm.In our daily life start and end with step by step process only.

    DEFINE FLOWCHART
    Flowchart is an pictorial representation of an ALGORITHM

     C language introduction. Before we learn C language we have to know something about c language.We have lot of questions while one new technology or new program or new thing will came once out in to the market. Who invented, what is the use. How we will use,It will use for me or not like these question will came in our minds. For these questions who raised in their minds please read total post for When C, Why C,Who developed C.

    C Language Development

    In 1972 a programmer Dennis Ritchie, created a new language name C. C superseded the old programming language he was using :B C was designed with one goal in mind writing operating systems.The language was extremely simple and flexible types of programs.It quickly became one of the most popular programming languages in the world.

    History of C Programming Language

    Dennis Ritchie is the founder of c language.
    It was developed to overcome the problems of previous languages B,BCPL, etc.
    Initially, c language was developed to be used in UNIX operating system.
    From the beginning, C was intended to be useful to allow busy programmers to get things done because C is such a powerful, domain and supple language, its use quickly spread beyond Bell labs. in the late 70's.

    Why Name "C" was given to Language ?

    1. Many of its principles and ideas were taken from earlier language B.
    2. Kene thompson was developed of B language.
    3. BCPL and CPL are the earlier ancestors of B language.
    4. CPL is Common Programming Language. In 1967, BCPL language( Basic CPL) was created as a scaled down version of CPL.
    5. As many of the Features were derived from "B" language thats why it named as "C".
    6. After 7-8 years C++ came into existence.

    Lets see the programming languages that were developed before c language

    LanguageYearDeveloped By
    Algol1960International group
    BCPL1962Martin Richard
    B1970Ken Thompson
    Traditional c1972Dennis Ritchie

    Features of C Language

    Fast and Efficient
    Programs written in C are efficient and fast.This is due to its variety of data type and powerful operators.
    Portable
    C is highly portable. This means that programs once written can be run on another machines with little or no modification
    Function and Rich Libraries
    C program is basically a collection of functions that are supported by C library. We can also create our own functions and add it to the C Library.
    Easy to Extend
    In C, New feature can be added at any time by programmer.
    Case Sensitive
    It is a case sensitive language, that it can differentiate the character is upper case or lower case.
    Powerful
    Provides wide verity of "Data types, Function,and Loop Control Statements.
    Bit Manipulation
    C Program can be manipulated using bits. We can perform different operations at bit level. We can manage memory representation at bit level.

    Define Compiler and Interpreter

    What is Compiler:

    A compiler is  nothing but a computer program that is used for transforms human readable source code of another computer program into the machine readable code that CPU can execute.

    What is interpreter:

    An interpreter is a computer program that directly executes,i.e performs, instructions written in a programming or scripting language,without previously compiling them into a machine language program.
    • Interpreter Takes single instruction as input.
    • No intermediate object Code is Generated.
    • Interpreter execute conditional control statements at a much slower speed.
    • Memory Requirement is Less.
    • Every Time higher level program is converted into lower level program
    • Errors are displayed for every instruction interpreted.
    • The interpreter can immediately execute high-level programs,thus interprets are sometimes used during development of a program,when a programmer wants to add small sections at a time and test them quickly.

    Distinguish Between Compiler and Interpreter

    compilerInterpreter
    Entire program(all lines) is scanned first and then gets translate into machine codeThe program is translated line by line
    Debugging of program is quite slow in compilersDebugging is very fast in case of interpreters
    Gives error messages regarding all errors present in the program all at a timeGives error message regarding to the first error that come across and stops translating remaining lines
    Takes time for program executionTakes more time for program execution

    Structure of C Program

    A C program may contain one or more sections as below.
    • Documentation section
    • Link Section
    • Global Declaration Section
    • main()Function Section
      {
      Declaration Part
      Executable Part }
    • Subprogram Section
    The Documentation section Consists of a set of comment lines giving the name of the program, the author and other details, which the programmer would like to use later.
    The link section provides instructions to the compiler to link functions from the system library.
    The definition section defines all symbolic constant. There are some variable that are used in more than one function.Such variables are called global variables and are declared in the global declaration section that is outside of all the functions.This section also declares all the user-defined functions. Every c program must have one main function section. This section contains two parts, declaration part and executable part.The declaration part declares 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 braces.
    The program execution begins at the opening brace and ends at closing brace.The closing brace of the main function section is the logical end of the program.All statements in the declaration and executable parts end with a semicolon(;). The subprogram section 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 may appear in any order.

    No comments

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728