170 likes | 449 Views
C-Language : Basic Concepts. 2013, Fall Pusan National University Ki- Joune Li. Basic Concepts. Plan Computer Programming Languages and C- Language Programming Procedure A Sample Program Programming Assignment - 1. Sequence of Instructions: Computer Program.
E N D
C-Language : Basic Concepts 2013, Fall Pusan National University Ki-Joune Li
Basic Concepts • Plan • Computer Programming Languages and C- Language • Programming Procedure • A Sample Program • Programming Assignment - 1
Sequence of Instructions:Computer Program C-Language: A Computer Programming Language • Program • Communication between human and computer • Program: A sequence of instructions to a computer • Programming Language: Syntax and Grammar of Program • Cf. Natural Language Programmer Computer Instructions
C-Language: A Computer Programming Language • C-Language • Developed in 1970s • Initially designed and developed for UNIX • Becomes a most popular computer programming language • In comparison with other languages • Relatively close to machine language • Easy to handle hardware and systems • Computer Engineer: Should be a native speaker of C-Language
Programming Procedure • Step 1: Design • Design Structures and Algorithms of the program • Step 2: Editing and Coding • Editing a program • With an editing or programming environment • Ex. Vi, emacs in Unix, MS visual studio, etc.. • Step 3: Compile • Translation of a program to (executable) machine code • Compiler • Step 4: Execute and Debug
Sample.obj Sample.c Sample.exe Results Programming Procedure Example Visual C/C++ MS-Windows Design Editing Compile Execution
Block A Sample Program
Variable Value 3. Sample Program
Type Declaration 3. Sample Program
3. Sample Program Statement
3. Sample Program Control Flow
3. Sample Program Condition
3. Sample Program Assignment
Operator 3. Sample Program Operator precedence : ( ) > *, / > …
3. Sample Program Input/Output
Basic Concepts of Sample Program • Block : { … } • Value, Variable • Type Declaration : integer, float, double, etc. • Statement and Semi-colon (“;”) • Control Flow : if .. else if … else • Condition • Assignment (“=“) • Operator, Operator Precedence • Function • Input and Output with printf and scanf