Class 9 | Principles of C Programming | C Programming Notes

  • Program

     

    The set of instruction through which human interact with the computer is known as program

     

    Programming Language

     

    The language which is used to given instruction to the computer is called a programming language. Example: Java, C ++, Python, Swift etc.

     

    History/Generation of Computer Language

     

    There are five generation of computer languages . They are given below:

     

    1’ First Generation Language (1GL):

     

    1GL uses the machine code to write instruction to interact with computer. Machine code is the binary code (0 and 1) understood by computer. It is also called machine level language.

     

    2’ Second Generation Language (2GL):

     

    2GL uses assembly language to write a program. Assembly language is made up of symbolic instruction. For example: ADD A, SUB A B

     

    3’ Third Generation Language (3GL):

     

    3GL uses structure programming language to write a program structure programming specify a logical structure on the program being written to write it more efficient and easier to understand and modify. For example: FORTAN, COBOL, C, Basic etc.

     

    4’ Fourth Generation Language (4GL):

     

    4GL uses non-procedural programming language. It consists of statement that is similar to the statement in the human language. These are used in the data base programming and scripting language. For example: SQL, MATLAB etc.

     

    5’ Fifth generation Language (5GL):

     

    5GL uses Artificial Intelligence (AI). AI language makes the computer appear to communicate like a human being.

     

    For example: OROLOG, LISP etc.

     

     

     

    Classification of computer language

    1’ Low Level Language:

     

    The language which is closer to machine language or computer language is called Low Level Language.

     

    The low level language is further divided into two different languages:

     

    A’ Machine Level Language:

     

    The language which is directly understood by the computer without translating them is known as machine level program are written in the form of binary code.

     

    Advantage

     

    1 The execution speed of this program is high.

     

    2 These language are efficient.

     

    3 It doesnt required the translator.

     

    4 It can be directly executed by computer.

     

    Disadvantage

     

    1 It is very difficult to develop the program.

     

    2 It is very difficult to debug the program.

     

    3 These program are very difficult to understand by human being.

     

    B’ Assembly Level Language:

     

    Assembly level language is a low-level language in which symbolic code are used as instruction. This language is also known second generation language.

     

    Advantage

     

    1 It is easy to develop understand modify the program.

     

    2 Less error are generated.

     

    Disadvantage

     

    1 It is a machine dependent language.

     

    2 Assembly language program are still complex.

     

    2’ High Level Language:

     

    The programming language which are used to simple English word, numbers to write the program is known as high-level language. The generation of language that belongs to high level language are as follows:

     

    A Third generation language (Structure oriented language),

     

    B Fourth generation language (problem oriented language),

     

    C Fifth generation language (Natural language) .

     

    Advantage of High-Level Language:

     

    1 Language are user friendly,

     

    2 Easier to learn,

     

    3 Easier to maintain,

     

    4 Easier to understand,

     

    5 Easier to run.

     

    Disadvantage of High-Level Language

     

    1 Compare to the low-level program they are generally less memory efficient.

     

    2 Cannot communicate directly with the hardware.

     

    3 It takes additional transaction time to translate the source code to the machine code.

     

    Types of High-Level Language:

     

    A’ Structural/Procedural oriented language(3GL):

     

    These are general purpose language which needs step by step instruction to produce the result. These are easier to understand, modify, and easy.

     

    These are machine independent. For example: C, C ++, Java, Pascal, PHP, FORTAN etc.

     

    B’ Problem Oriented Language(4GL):

     

    These are specific language which dont need step by step instruction to produce the result. These are also machine independent and are easier to understand, modify and find error. For example: SQL, ORACAL etc.

     

    C’ Natural Language(5GL):

     

    The language used by human being is called natural language or language used by fifth generation to make them interact more naturally with human life manner is called natural language. These language is been design to use for AI and expert system.

     

    Classification of SOFTWARE

     

     

     

     

     

     

    SYSTEM SOFTWARE

     

     

     

     

     

     

    O

     

     

     

     

     

    W

     

    A

     

     

     

    OPERATING SOFTWARE

     

     

     

    UTILITY SOFTWARE

     

     

     

    LANGUAGE TRANSLATOR

     

     

     

     

     

     

     

    COMPILER

     

     

     

    ASSEMBLY

     

     

    INTERPRETER

     

     

     

    TAILORED SOFTWARE

     

    APPLICATION SOFTWARE

     

     

    PACKAGED SOFTWARE

     

     

     

    Software:

     

    A software is the collection of program to achieve a particular goal. A software tells the computer what to do and how to do.

     

    Types of software:

     

    1’ System software:

     

    It is the group of program that perform the internal operation of computer system such as controlling I/O devices managing files and managing storage area within computer is called system software.

     

    The purpose of system software is to make use of computer more efficient and easier. It can be divided as follows:

     

    I Operating system software

     

    Ii Utility software

     

    Iii Language translator

     

    A’ Operating system software:

     

    Operating system software is a system software which manages the overall operation of computer system. It act as a bridge between user and computer hardware. For example: Windows, Linux, Unix, IOS, Android etc.

     

    B’ Utility software:

     

    It is also called system support software which provides useful service to the user of computer. These are used improve performances of the computer system. Some function performed by utility software are:

     

    1 File compression

     

    2 Software can used to reduce the size of file

     

    3 A backup utility software can help to keep safe the file from being loss

     

    4 Antivirus utility software can help to examine a disk by for hidden virus

     

    C’ Language Translator:

     

    A language translator is system software that converts program written in high-level language into a machine language. A program written in high-level language is called source code or source program. To convert the source program to machine program also vice versa the translator is required. It also detects the error during translation process.

     

    A translator takes a program written in source language as a input and convert it into a machine language as a input.

     

    Some of the translating program are : Compiler, Assembler, Interpreter.

     

    1’ Compiler:

     

    It is a software that takes high level language as a input and translate it into a machine language program is called compiler. It scan the interior program and then translate it into a machine program.

     

    For example: Turbo C, Dev C, Borland etc.

     

    2’ Interpreter:

     

    It is also a translator program that translate source program into machine program. It translate the program line by

    line and provides the error information.

     

    For example: QBasic, Ruby, Pear etc.

     

    3’Assembler:

     

    It is a translator program that translate source program written in assembly language into machine language.

     

    2’ Application Software:

     

    The software which full fill the requirement of user is called application software. Or the software that helps to perform a task to users is called application software.

     

    For example: Microsoft Office, photoshop etc.

     

    Type of application software are given below:

     

    1’ Tailored/customized software:

     

    The software especially designed to need the specific requirement of an organization or a individual is called tailored/customized software. Or it refers to software that has been developed by single person or company . For example: Mobile Apps, product Development etc.

     

    2’ Packaged software:

     

    Packaged Software is a collection of programs that perform similar function or have similar features or the software that is use to perform specific task according to the user needed is called packaged software. For example: MS Excel , power point etc.

     

    1. Different between compiler and interpreter.

     

    Compiler Interpreter
       
    1 It translate the entire program at a time. 1 It translate one statement at a time.
       
    2 It is faster than interpreter. 2 It is slower than compiler.
       
    3 It is both useful to small and large program. 3 It is only useful for small program.
       
    4 Debugging process is difficult. 4Deubgging process is easier.
       
    5 It requires more space in memory. 5 It requires less space in memory.
       
    6 Syntax error are not known unit complication is 6 syntax error are known at each line.
    completed.  
       
    7eg: c, c ++ uses compiler 7 eg: ruby, QBasic uses interpreter
       

     

     

    1. Different between program and software.
    Program Software
       
    1 Program is the set of instruction that given to 1 It is a collection of programs to perform the
    the computer as command. particular tasks or goals.
       

     

    2 Program are small in size. 2 Software are large in size.
       
    3 It is developed by single programmer. 3 It is developed by group of programmer.
       
    4 It doesnt required licence to use. 4 Licence is required for commercial software.
       
    5 eg: C program use to find sum of given 5 eg: MS word, MS excel etc.
    number.  
       

     

     

    Program design tools

     

    The program design tool are the tool required to develop the program. During designing the program various tools are required to design the program such as: Algorithm and Flowchart.

     

    ALGORITHM

     

    An algorithm is a set of step of step operation to solve a problem performing calculation, data processing tasks. An algorithm is an efficient method that can be expressed within single amount of time and space. While writing an algorithm you need to follow certain guidelines:

     

    1. It should contain a finite number of instructions.

     

    1. Each instruction should be clear and unambiguous.

     

    • It should not depend on any programming language.

     

    iv)It should be well-ordered in the form of input, process and output.

     

    Advantage

     

    1. Easy to design as each step can be written using English language.

     

    1. Easy to understand, modify and implement.

     

    • No standard form or format required.

     

    Disadvantage:

     

    1. Writing an algorithm is fast but writing algorithm for large and complex program may be time consuming.

     

    1. Difficult to converting algorithms into programs.

     

    Example:

     

    Algorithm for adding two numbers:

     

    Step 1: Start

     

    Step 2: Input two numbers X and Y

     

    Step 3: Read to numbers X and Y

     

    Step 4: Z=X+Y

     

    Step 5: Display the result

     

    Step 6: End/Halt/Exit/Stop

     

    Flowchart

     

    A flowchart is a graphical representation of step of step programs. It uses different symbol to denote the flow of different type of instruction. These symbols are connected by solid line called arrow to indicate the flow of instructions.

     

    The symbols used in flowchart are:

     

    Symbol

     

     

    Name

     

     

    Function

          Start/End An oval shape represents the  
            start or end operation.  
               
          Input/ Output An parallelogram represent  
            input or output operation.  
               
          Process A rectangle shape represent  
           
            the processing operation.  
               
               
          Decision A diamond shape represent the  
            decision operation.  
               
          Arrows This is a line connector that  
            shows relationship between  
            representive shapes.  
               

     

     

    Eg: Flowchart for adding two numbers

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Application software

     

    Application software is a computer software package that perform a specific function. The application software can be used in many sectors such as:

     

    A’  Business Application:

     

    It is a set of computer program that are used by business users to perform various business functions accurately. These application are used to increase the productivity. Those are categories as small and large medium. For eg: MS office, Customer relationship management, business process management , E business system etc.

     

    B’ scientific Application:

    An application that simulates real world activities done into mathematical calculation and their actions are simulated by executing the required formula. For eg:

     

    Weather forecasting system, navigation system, AUTOCAD, geographic information system, MATLAB, ORCAD etc.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *