You are on page 1of 4

CHAPTER 1: BASIC OF PROGRAMMING

What is program?
A finite set of precise & clear instructions given to a computer to achieve a desired
result.
Programming languages: C, C++, C#, JAVA, PASCAL, ADA, ALGOL, LOGO, LISP,
COBOL, FORTRAN etc.

NEED OF PROGRAMMING LANGUAGES:


Why not write programs in English, Hindi, Gujarati, and Marathi etc?
A sentence in English, Hindi, Gujarati, and Marathi etc may not have just are
meaning for computers to properly each sentence has to be clear and precise.
Programming languages when used allows us to write an introduction that has only
one meaning. It consists of set of predefined rules called SYNTAX.

NEED OF COMPILER:
Computers neither understand English, Hindi, Gujarati, nor does it understand any of
the programming languages, it only understand 1 and 0. So to converter a program
(source code) into 1 and 0 a special translator program is used called compiler. It
converts source code into machine understandable language (1, 0) known as object
code (obj file). The object code is then linked if need with library functions giving
executable word (exe.file). The process of linking is done by a program called linker
and than a program called loader, loads the program in memory along with the data
required to give us the output. Fig1.2 shows the process of getting output.

CHARACTERISTIC OF A GOOD PROGRAM:

Program must end after finite number of steps.


Instruction must be precisely defined i.e. no multiple meanings.
Instruction must be effective i.e. should be carried out exactly.
A program may take zero or more inputs.
A program may produce one or more outputs.

STEPS FOR CREATING A PROGRAM:


1] What is to be done?
2] What are the requirements?
3] Algorithms: An algorithm is a sequence of logical steps required to perform a
specific task.

4] Flowchart: It is a graphical representation of sequence of operations. It used


different shapes to represent different instructions.
Following are useful symbols for representing the flowchart:

Circle

connector

5] Dry run
6] Code the program
7] Test & debug the program
8] Documentation user manual
Technical manual
9] Maintenance & upgrade

CHAPTER 2: BASIC OF C PROGRAMMING

STRUCTURE OF C PROGRAM

Documentation
Symbolic constant definition
File include section
Global variable declaration

Main( )
{
Declarations;
------------Executable statement;
-------}
Function 1 ( )
{
}
Function 2 ( )
{
}
Function n ( )
{
}

MY FIRST PROGRAM
#include<stdio.h> // include information about standard library //
main() // defined to be function that expects no arguments, which is indicated by the
empty list() //
{
Printf(PARIMAL); // printf function with argument PARIMAL, it also called string
constant

MY SECOND PROGRAM
Demonstrate use of \n,\t, clrscr(), getch()
#include<stdio.h>
Void main( )
{
clrscr( ); //clear screen//
printf(PARIMAL);
printf(\n\n\n\n\t\t SRLIM);
getch(); //direct only for o/p//
}

HISTORY OF C
The origin of c has been dated back to 1972 in Bell Laboratory by Dennis.M.Ritchie.
It was derived from BCPL (Basic Combined Programming languages). It was
standardised in 1989 by American National Standard Institute (ANSI).

Features of C
1] C is a structured language. It allows program to be broken into small pieces
known as functions. These functions once generated are reusable. A set of such
functions then becomes a C program.
2] C is portable language means C program can be run in different OS and compiler
with negligible modification.
3] C is middle level language. It is combination of high level and low level
programming.

You might also like