Introduction to Programming Language using C

22
TRINITY INSTITUTE OF PROFESSIONAL STUDIES Sector 9, Dwarka Institutional Area, New Delhi-75 Affiliated to Institution of G.G.S.IP.U, Delhi Introduction to Programming Language Using C Paper ID : 20105 Paper Code : BCA105 HARI MOHAN JAIN Assistant professor

Transcript of Introduction to Programming Language using C

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Affiliated to Institution of G.G.S.IP.U, Delhi

Introduction to Programming

Language Using C

Paper ID : 20105Paper Code : BCA105

HARI MOHAN JAINAssistant professor

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

UNIT IC basics: C character set, Identifiers and keywords, Data types, constants,variables and arrays, declarations, expressions statements, symbolic constants,compound statements, arithmetic operators, unary operators, relational andlogical operators, assignment operators, conditional operators, bit operators.C constructs: If statement, if….else statement, if…..else if….else statement,while statement, do….while statement, for statement, switch statement, nestedcontrol statement, break operator, continue operator, comma operator, gotostatement.

UNIT – IIC Functions: Functions: declaration, definition & scope, recursion, call by value,call by reference.Storage Classes: automatic, external (global), static & registers.Arrays: Arrays, pointers, array & pointer relationship, pointer arithmetic,dynamic memory allocation, pointer to arrays, array of pointers, pointers tofunctions, array of pointers to functions, Preprocessor directives: #include,#define, macro’s with arguments, the operators # and ##, conditionalcompilations.

Syllabus

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

UNIT – IIIStructures: Structures, unions, passing structure to functions, bit fields,

file handling [text (ASCII), binary] [T1,T2,T3]

UNIT – IVString manipulation functions and other standard library functions from

stdio.h, stdlib.h, conio.h, ctype.h, math.h, string.h, process.h. Usage of command line arguments.

Syllabus

Suggested Books:Yashwant Kanetkar, “Let us C”BPB Publication

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

What do you mean by Programming Language?

A Programming Language is acomputer language used togive command to computerto perform some task.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

What is a Computer?

A Computer is an electronicsdevice which takes input fromuser, process it and give backthe output to the user.

Computer Stands for CommonOperating Machine Particularly Used forTraining, Education and Research.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

A Computer takes data as Input from user and convert it into information by processing it.

What does a Computer do ?

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Block Diagram of a Computer

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

What is Input Device?

Devices used to provide input ordata to Computer is Known asInput Devices. Commonexamples of Input Devices areKeyboard, Mouse, Scanner etc.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

What is Output Device?

Devices used to display outputor Information by the Computeris Known as output Devices.Common examples of outputDevices are Monitor, Printer,Speakers etc.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Software & Hardware?

• Computer Instructions or data, anything that can be stored electronically is Software.

• Hardware is one that is tangible. The storage devices (Hard disk, CD’s etc.,), mouse, keyboard CPU and display devices (Monitor) are Hardware.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Types of Software

» System Software

» Application Software

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

System Software:

System Software includes the Operating System and all the utilities that enable the computer to function.

System software is a term referring to any computer software which manages and controls the hardware so that application software can perform a task.

Example:

Operating Systems, Compiler, Interpreter.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Application Software:

Application Software includes programs that do real work for

User.

Example:

Word Processor, Spreadsheet and Database Management System, Payroll systems, Inventory Control, Manage student database, etc.,

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Operating System:

• Operating System is a software, which makes a computer to actually work.

• It is the software the enables all the programs we use.

• The OS organizes and controls the hardware.

• OS acts as an interface between the application programs and the machine hardware.

• Examples: DOS, Windows, Linux, Unix and Mac OS, etc.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Machine Language

The only language understood by acomputer is machine language.Each computer had its own machine

language, which was made of

streams of 0s and 1s.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Low Level Language

Programming language which is machinedependent(Hardware) is known as Low levellanguage. Their prime function is tooperate, manage and manipulate thecomputing hardware and components.Example: Machine language, Assemblelanguage

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Programming language which ismachine independent (Hardware)is known as High level language.Example: Basic, ForTran, Java,

VB etc

High Level Language

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Programming language havingfeatures of both High levellanguage and low level languageis known as Middle levellanguage.Example: C, C++

Middle Level Language

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Source Code and Object Code

• A program written in a Programming language is called source code.

• The programs are translated into machine language by interpreters or compilers.

• The resulting machine language code is known as object code.

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Compiler:

A compiler is a program that Convert source code into machine code(object code).

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Interpreter:

An interpreter is a computer program that translates and executes instructions written in a computer programming language line-by-line, unit by unit etc.,

Example: Lisp systems, etc.,

TRINITY INSTITUTE OF PROFESSIONAL STUDIESSector – 9, Dwarka Institutional Area, New Delhi-75

Thank You