Вы находитесь на странице: 1из 29

DEC2012 - FUNDAMENTAL

PROGRAMMING (C Language)

CHAPTER 1: Introduction to Programming


At the end of this presentation, you will be able to:
Define what a program is
Describe what programming is
List the types of programming languages
List the various programming methodologies
C programming language developed in 1972 by
Dennis Ritchie at AT&T Bell laboratories. Because C
was designed as a language in which to write the
UNIX operating system, it was originally used
primarily for systems programming. Over the years,
however, the power and flexibility of C, together
with the availability of high-quality C compilers for
computers of all sizes, have made it a popular
language in industry for wide variety of applications
/* My First Program */

#include <stdio.h>
int main(void)
{
printf( Hello World! \n ) ;

return 0 ;
}
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).The
most common reason for converting a
source code is to create an executable
program.
Programming language is the language
through which humans communicate with
computers. manusia berkomunikasi dengan
komputer.
Program is the set of instructions that you
give to the computer to perform any task. set
arahan yang anda berikan kepada komputer
untuk melakukan tugas apa pun
Programming is the process of writing
these instructions. proses menulis arahan

Programmer is the person who writes the


program. orang yang menulis program.
Programming languages are broadly classified
into two types:

Low-level languages
High-level languages
Programs are written based on the internal
architecture of machines. Program ini ditulis
berdasarkan pada senibina dalaman .

Programmers must have extensive knowledge


of the machine hardware. Pengaturcara perlu mempunyai
pengetahuan luas tentang peranti keras mesin.
Low-level languages are divided into two
types. They are:

Machine language
Assembly language
Language that computers can understand.
Instructions in this language are in the form of 1s
and 0s.
Examples
101000010011001101 - Adding two numbers.
101000100011001101 - Subtracting two
numbers.
The computer processes the instructions in
machine language very quickly. Komputer
memproses arahan di dalam bahasa mesin sangat cepat.
Programmers must have knowledge of the
machine hardware and its configuration.
Programmer needs to remember a number of
binary codes to write machine language
programs.
Machine language programs are very difficult
to debug.
Uses symbolic instructions (mnemonics) to
represent the instructions in the programs.
Examples
ADD R1 R2 Adds two numbers stored in
registers R1 and R2.
SUB R1 R2 Is the instruction in assembly
language to subtract two
numbers stored in the
registers R1 and R2.
It is easy for programmers to remember the
alphanumeric codes than the binary codes.
Debugging is very easy when compared to
machine language.
The major disadvantage is that, it is machine
dependent.
Languages that use English words and
mathematical symbols for writing programs.
Examples
a+b Adds the variable a and b.
a-b Substrates the variable b from a.
Programs are almost machine-independent.
It is not necessary for the programmer to have
knowledge about computer hardware.
It is very easy to learn and write programs in
high-level languages.
Programs written in high-level languages are
slower in execution than the programs written
using low-level languages.
In this presentation, you learnt the following:
Programming language is the language through
which humans communicate with computers.
Program is the set of instructions that you give
to the computer to perform any task.
Programming is the process of writing these
instructions.
Programmer is the person who writes the
program.
In this presentation, you learnt the following:
Low-level languages are programming
languages in which programs are written
based on the internal architecture of
machines.
High-level languages are languages that use
English words and mathematical symbols for
writing programs.
1. Differentiate between low-level and high-
level language.
2. Differentiate between assembly and
machine language.
There are different ways that can be followed
when writing a program.
Some of them are:
Structured Programming
Modular Programming
Object- Oriented Programming
Programming methodology in which the
instructions are written in a sequence.
Programming methodology in which the complex
program is broken into number of simple
modules.
A module is an independent segment of the
program that performs a specific task.
When compared to structured programming,
writing and debugging modular programs are
easy.
Programming methodology in which the data
and the code are treated as a single unit.
In this presentation, you learnt the following:
Structured programming is a programming
methodology in which the instructions are written in
a sequence.
Modular programming is a programming
methodology in which the complex program is
broken into number of simple modules.
Object-oriented programming is a programming
methodology in which the data and the code are
treated as a single unit.
1. Differentiate between structured
programming and object-oriented
programming.

Вам также может понравиться