You are on page 1of 15

DEC 2012 :

FUNDAMENTAL PROGRAMMING

INTRODUCTORY
TO PROGRAMMING
CHAPTER 1
COURSE LEARNING OUTCOME (CLO) :
CLO1 (Apply knowledge of basic concepts and fundamentals of structured programming.)
know the programming language

C Programming

C language is used for creating computer


applications and also used a lot in writing
embedded software/firmware for various
electronics, industrial and communications
products which use micro-controllers.

It is also used in developing verification


software, test code, simulators etc. for
various applications and hardware
products.
2
DEC 2012 - FUNDAMENTAL PROGRAMMING
know the programming language

Background of C Programming

The C programming language was


pioneered by Dennis Ritchie at AT&T
Bell Laboratories in the early 1970s.

C is a higher-level language
provides capabilities that enable

3
DEC 2012 - FUNDAMENTAL PROGRAMMING
know the programming language

Sample of C Program
Basic C Program

4
DEC 2012 - FUNDAMENTAL PROGRAMMING
know the programming language

Sample of C Program
Output :

HELLO WORLD

5
DEC 2012 - FUNDAMENTAL PROGRAMMING
The Basic Structure of a C Program

6
DEC 2012 - FUNDAMENTAL PROGRAMMING
know the programming language

Compile & Execute Programs

A compiler is a computer program (or set of


programs) that transforms source code
written in a programming language (the
source language) into another computer
language (the target language, often having a
binary form known as object code).
At compiling time the program are scan for
any syntax and semantics error.
The most common reason for converting a
source code is to create an executable
program.
7
DEC 2012 - FUNDAMENTAL PROGRAMMING
know the programming language

Compile & Execute Programs

An executable file or executable


program, or sometimes simply an
executable, causes a computer to
perform indicated tasks according
to encoded instructions.

8
DEC 2012 - FUNDAMENTAL PROGRAMMING
know the programming language

Steps to write C programs and get the output


Below are the steps to be followed for any C
program to create and get the output.

9
DEC 2012 - FUNDAMENTAL PROGRAMMING
know the definition and types of programming

Introduction to Programming
Concept and Terminology

Defining Terms
Programme - A set of instructions that tells the
computer what to do
Programmer A person who is involved in the
programming phases.
Programming language is the language
understood by the computer, used to tell the
computer what to do.

10
DEC 2012 - FUNDAMENTAL PROGRAMMING
know the definition and types of programming

Types Of Programming Language


Machine languages
is a true computer language
machine specific instructions, consists of binary numbers
Example : 0 and 1.
lowest level representation of computer program

Assembly languages
Using mnemonics to represent machine language instructions
(translated via assemblers)
Example : mov ax, 1234h (mov value 1234h into register ax)

High-level languages
Codes similar to everyday English
Use mathematical notations (translated via compilers)
Example : grossPay = basePay + overTimePay 11
DEC 2012 - FUNDAMENTAL PROGRAMMING
understand the types of programming and structure programming methodology

Types of Programming

Structured Programming
Functional / Modular Programming
Object Oriented Programming (OOP)

12
DEC 2012 - FUNDAMENTAL PROGRAMMING
understand the types of programming and structure programming methodology

Types of Programming

Structured Programming
Computer programming in which the
statements are organized in a
specific manner to minimize error or
misinterpretation.
Examples : ALGOL, Pascal, C, PL/I
and Ada.
13
DEC 2012 - FUNDAMENTAL PROGRAMMING
understand the types of programming and structure programming methodology

Types of Programming

Functional / Modular Programming


Modular programming is subdividing
program into separate subprograms
such as functions and subroutines.
make program shorter, hence easier
to read and understand.
Examples : Scheme, LISP
14
DEC 2012 - FUNDAMENTAL PROGRAMMING
understand the types of programming and structure programming methodology

Types of Programming

Object Oriented Programming (OOP)


A computer programming
methodology that focuses on data
rather than processes, with programs
composed of self-sufficient modules
(objects) containing all the information
needed to manipulate a data structure.
Abbreviated OOP.
Examples : Java, C++ 15
DEC 2012 - FUNDAMENTAL PROGRAMMING

You might also like