Ch3 - Click to edit Master subtitle style CSEB114:...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Click to edit Master subtitle style CSEB114: Principle of Programming Chapter 3: Fundamental of C Programming Language and Basic Input / Output Function 6/1/11 prepared by NI, edited by MAF Fundamental of C and Input / Output prepared by NI, edited by MAF In this chapter you will learn about: C Development Environment C Program Structure Basic Data Types Input/Output function Common Programming Error 6/1/11 prepared by NI, edited by MAF C Development Environment prepared by NI, edited by MAF { F 1 A 8 3 A 6 -2 1 A 2 -4 B 7 3 -A 5 C F -C F D 3 8 C 8 0 B D 0 4 } Phase 1 { 9 1 8 2 F 2 A 5 -4 1 5 7 -4 2 1-9 5 4 -F 6 B 4 2 F 2 1 4 F 1 8 } Editor { C 0 E 9 E D B F -A 5 2 B -4 B 7 C -8 C 9 4 -7 E B 1 B 4 A 5 1 3 2 7 } Phase 2 { C 3 2 3 4 2 C-E 0 4 C -4 2 C 5 -9 F D 2 -C 0 B 9 A 9 D 6 3 B E D } Preprocessor { 1 7 6 7 0 B D F -5 1 0 B -4 F B C -9 1 0 2 -7 A 1 6 1 9 D 2 8 A 9 } Phase 3 { C 1 E 3 D 8 2 -3 4 3 -4 F C 7 -8 3 5 E -E B 1 8 A 5 3 E 6 2 } Phase 5 { 3 6 3 D D E C A -2 5 3-4 6 2 -9 7 2 D -4 D 1 8 4 8 C 5 1 2 5 A } Phase 4 { 0 F A E F A 6 E -C 6 B C -4 B 2 5 -8 A B 8 -4 C A 7 5 7 1 5 3 D } Phase 6 { 1 5 6 0 B F 7 A -3 D C -4 7 4 3 -B E B A -E D 1 E B 2 8 F 6 A C } Compiler { 1 2 D E 8 F C A -D 3 B 1 -4 A D D -B 4 A -A 6 8 2 5 8 B 3 7 C 2 } Linker { A D B 8 B 6 E C -7 2 F 1 -4 8 0 8 -A 6 B D -7 1 6 C 5 0 5 3 B 8 A } Loader { 5 F 1 2 0 E 3 -2 1 8 F -4 6 C -A F 4 3 -7 6 7 2 9 B 6 D 6 A 2 C } CPU (Execute) Disk Disk Disk Disk Disk Disk Program is created using the Editor and stored on Disk. Pre-processor program processes the code. Compiler creates object code and stores it on Disk. Linker links object code with libraries, creates a.out and stores it on Disk Loader puts Program in Memory CPU takes each instruction and executes it, storing new data values as the program executes. 6/1/11 prepared by NI, edited by MAF Entering, translating, and running a High-Level Language Program C Development Environment prepared by NI, edited by MAF 6/1/11 prepared by NI, edited by MAF C Program Structure prepared by NI, edited by MAF An example of simple program in C #include <stdio.h> int main(void) { printf(I love programming\n); printf(You will love it too once ); printf(you know the trick\n); 6/1/11 prepared by NI, edited by MAF The output prepared by NI, edited by MAF The previous program will produce the following output on your screen I love programming You will love it too once you know the trick Press any key to continue 6/1/11 prepared by NI, edited by MAF Preprocessor directives prepared by NI, edited by MAF a C program line begins with # provides an instruction to the C preprocessor It is executed before the actual compilation is done....
View Full Document

This note was uploaded on 06/01/2011 for the course ECON 101 taught by Professor Yip during the Spring '11 term at Al-Quds University.

Page1 / 41

Ch3 - Click to edit Master subtitle style CSEB114:...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online