Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
• No programming experience is
assumed
• This course will cover topics
from introductory to Advanced
level
Malaysian Institute of Aviation Technology
What is a program?
• A list of instructions.
• Written in a programming language (c, c++,
java).
• Determines the behavior of a machine
(computer, robot).
Malaysian Institute of Aviation Technology
Programming Language
History
• C was developed in 1972 by Dennis
Ritchie at Bell Laboratories.
• Based on a programming language called
B (which is derived from BCPL language).
• C was designed and developed for the
development of UNIX operating system.
• C has been widely used to develop many
type of application software from a basic to
operating system.
Malaysian Institute of Aviation Technology
Development
stages of C
program
Malaysian Institute of Aviation Technology
Editing
• Process of writing the C source code.
• Using editor program (i.e. vi and emacs for
Linux, Notepad for Windows)
• Software package provides programming
environment
– Integrated editor
– Managing and maintaining source code
– i.e. C++ Builder, Code::Blocks, Dev-C++,
Microsoft Visual Studio
Malaysian Institute of Aviation Technology
Linking
Executing
C Program Layout
• C program consists of two sections:
– Pre-processor directives
– Main function
/* an example of C program */
#include <stdio.h> Pre-processor directives
Pre-processor Directives
Main Function
An Example of C Program
Sample output:
C program example
Malaysian Institute of Aviation Technology
Malaysian Institute of Aviation Technology
1. Coding
2. Compiling
3. Testing (running and debugging)
4. If problem, repeat 1-3 again
• In This Chapter:
i) We creat our ‘FIRST C” PROGRAM
ii) We discover variable.
iii) We learn about the function of printf, scanf and
getchar
Malaysian Institute of Aviation Technology