1st C- Programming Basics

Embed Size (px)

Citation preview

  • 8/10/2019 1st C- Programming Basics

    1/21

  • 8/10/2019 1st C- Programming Basics

    2/21

  • 8/10/2019 1st C- Programming Basics

    3/21

    NOTES

  • 8/10/2019 1st C- Programming Basics

    4/21

    Programming para igm Paradigm means organizing principal of a program. It is an approach to programming.

    Different programming paradigmProcedural programming :-In procedural Program the emphasis is ondoing things rather data. Following focus points about proceduralprogramming:-

    Emphasis is on doing things.Global data is loosely available to all function.There is no data security.Procedural oriented approach does not model real world problem.It does not encourage reusability of code.

    C --supports Procedural Programming Modular Programming :-Large Program is broken down into smallerunits i.e., function (sub Program). The idea of breaking a into functioncan further be extended by grouping a number of functions togetherinto a larger entity called a module.Object oriented Programming :- Object oriented Programmingparadigm is based on the principal of data hiding, abstraction,inheritance and polymorphism. It implements Programs using classesand objects. It supports reusability of code so it is very close to real

    world. Data and function are encapsulated to ensure data safety andsecurity.

    NOTES

  • 8/10/2019 1st C- Programming Basics

    5/21

    History of Language

    The C programming language was designed by Dennis Ritchie at BellLaboratories in the early 1970s.

    It derived from a computer language named B and from an earlierlanguage BCPL.

    As the language further develop and standardized a version known asANSI American National Standard institute) C became dominant

    This language was originally designed and implemented on the UNIX operatingsystem on DEC PDP11 by Dennis Ritchie at bell labs and entire UNIX was

    written in C.

    Features of LanguageIt is Middle LEVEL Languages.

    It is procedural program.It is case sensitive it treats upper andlowercase differently.C Language uses Compiler for translation.It learns basic programming skills.

    NOTES

  • 8/10/2019 1st C- Programming Basics

    6/21

    EXTRA

  • 8/10/2019 1st C- Programming Basics

    7/21

    NOTES

  • 8/10/2019 1st C- Programming Basics

    8/21

    EXTRA

  • 8/10/2019 1st C- Programming Basics

    9/21

    OR PreprocessorsEXTRA

  • 8/10/2019 1st C- Programming Basics

    10/21

    PREPROCESSING AND STANDARD LIBRARIES

    It is the directives written in a program.

    It is always before the main().

    It does not terminated by semicolon sign.

    Most useable when our program are more Larger

    and has to managed multiple files.

    #

    EXTRA

  • 8/10/2019 1st C- Programming Basics

    11/21

    OR PreprocessorsEXTRA

  • 8/10/2019 1st C- Programming Basics

    12/21

    OR PreprocessorsEXTRA

  • 8/10/2019 1st C- Programming Basics

    13/21

    Stdio.h String.h math.h Stdlib.h

    Scanf ()Printf(gets()puts()

    getchar()putchar()

    strlen()strcpy()strcmp()strcpy()

    strcat()

    sin()cos()pow()SQRt()

    tan()exp()log()

    malloc()realloc()abs()free()

  • 8/10/2019 1st C- Programming Basics

    14/21

    FILE INCLUSION

    #include#include filename is also permitted

    A Filename written in < > is searched in its standardlibrary.

    A Filename in is searched first current directory and if not

    found will then be searched in the standard directory .

    EXTRA

  • 8/10/2019 1st C- Programming Basics

    15/21

    COMPILER CONTROL DIRECTIVES

    This is the need of developing large programs andto make the code portable to more than one

    specific type of condition.

    The control may change the execution pathdepending upon the current environment.

    NULL DIRECTIVE # -> has no effect.

    EXTRA

  • 8/10/2019 1st C- Programming Basics

    16/21

    NOTES

  • 8/10/2019 1st C- Programming Basics

    17/21

    NOTES

  • 8/10/2019 1st C- Programming Basics

    18/21

    NOTES

  • 8/10/2019 1st C- Programming Basics

    19/21

    NOTES

  • 8/10/2019 1st C- Programming Basics

    20/21

    NOTES

  • 8/10/2019 1st C- Programming Basics

    21/21

    NOTES