Welcome to C World

Hello to Everyone, This site is for C Beginners as well as c lovers.I Have added some useful stuff like C Programs, C Interview Questions and C Excercise. I am doing work on my blogspot website.I will add all the C related stuff time to time.

Visit this site and give comments, post ur problems and give suggestions.
Have a nice visit. :)

Chapter 1 - 5

Introduction

  1. Introduction to C

    'C' is a General Purpose structured programming language. Intially 'C' was used for creating system software. Today 'C' is used by programmers for virtually any programming task. 'C' was invented and first implemented by Dennis Ritchie on DEC PDP-11 machine using UNIX operating system.'C' is the result of a development process that started with an older language caleed BCPL(Basic Combined Programming Language), developed by Martin Richards. 'C' is developed at AT & T's Bell Laboratories of USA in 1972.
  2. Features of C

    1. General Purpose Programming Language :-
    2. C was originally developed for system programming, but it is also used for writing commercial as well as scientific applications.
    3. Structured Programming Language :-
    4. C Provides the fundamental flow-control constructs required for well-structured programs.It allows developing well-defined, portable and easy to maintain programs.
    5. Modularity :-
    6. We can break down the program code into functional units, develop independent codes and then integrate them to make a complete application.The difference modules can be present in different files and can be compiled separately, thereby facilitating team participation in development.
    7. Portability :-
    8. C programs written for one computer can executed on another with little or no modifications. C programs written to work under UNIX operating system can be easily ported to work under MS-DOS operating system with little source code modifications.C portability facilitates the use of a new computer with a different operating System. C programs can be easily ported to a new hardware or operating system ot both.
    9. Ability to Extend Itself :-
    10. A C program is basically a collection of functions that are supported by the C library. We can continously add our own functions to the C library.With the availability of a large number of functions, the programming task becomes easier.
    11. Limited Number of Key Words :-
    12. There are only 32 Key Words in C. The Strength of C lies in its in-built functions.Several standard functions are available with C that are used for developing programs.
  3. 'C' Program Structure

    #define MAX 100 <-----------Pre-processor Directives
    #include<stdio.h> <-------------------Pre-processor Directives 
    int i =10; <-----------------------Global Declarations 
    int j =20; <-----------------------Global Declarations 
    main() <--------------------------Function name 
    { <--------------------------------Start of Function 
    ......... <--------------------------Program Structure 
    ......... <--------------------------Program Structure 
    } <--------------------------------End of Function
    1. Pre-processor Directive(s) :-
    2. All 'C' compilers uses as their first phase of compilation a pre-processor, which performs various manipulations on the source file before it is actuallly compiled. #include directives tells the pre-processor to read in another file and include it with our program.The most commonly required header file is called stdio.h. All header files end with .h extention
    3. Global Declaration(s) :-
    4. There are two places where variables are declared. A) Inside a function B) Outside all functions. Varialbles declared outside all functions are called global variables and they may be accessed by any other function in the program. Global variables exist the entire time the program is executing.
    5. Function(s) :-
    6. A function is a set of instructions aimed at achieving a pre-defined goal or objective. Every 'C' program must have one main() function. Based on requirements we may provide additional functions in a 'C' program. The functions body comprises of two parts: A) Variable declarations. B) Executable statements. All variables to be used in the function, must be combined and put together before the first of executable line. There is at least one executable statement in 'C' program. The two parts of a function A) Variable Declaration and B) Executable statements must appear between the opening '{' and closing braces '}'. All statements in the declaration and executable parts end with a semicolon ';' known as statement terminator.
    7. Programming Style :-
    8. 'C' is a case sensitive programming language. i.e. it will treat BOY,Boy and boy differently. 'C' is a free-form programming language. The 'C' compiler does not care where on the line we begin typing. The developer can use this flexibility to make easy readable programs. A statement in 'C' can start anywhere on a line and end anywhere on the line. The same statement can span several line and the same line can contain several statements. One or more "white spaces" will have to separate one word from another and where one "white space" is legal, any number of "white spaces" are legal. By "white spaces" we imply either a space or a tab or a carriage return.
footer