Download presentation
Presentation is loading. Please wait.
Published byLauren Matthews Modified over 9 years ago
1
Computer Programming I Hour 1-Getting Started
2
Word of Day —Chinese proverb A journey of a thousand miles is started by taking the first step. —Aristophanes High thoughts must have high language.
3
OUTLINE In this first lesson you'll learn the following: What C is Why you need to learn C The ANSI standard Hardware and software required in order to run the C program
4
What Is C? C is a programming language The C language was first developed in 1972 by Dennis Ritchie at AT&T Bell Labs. C is a high-level programming language You can imagine that the lowest-level languages are machine languages that computers understand directly The high-level programming languages, on the other hand, are closer to our human languages.
6
What Is C? High-level programming languages, including C, have the following advantages: Readability: Programs are easy to read. Maintainability: Programs are easy to maintain. Portability: Programs are easy to port across different computer platforms
7
What Is C? Each high-level language needs a compiler or an interpreter to translate instructions written in the high-level programming language into a machine language that a computer can understand and execute
9
What Is C? A CPU has millions of transistors that make use of electronic switches. The electronic switches have only two states: off and on. (Symbolically, 0 and 1 are used to represent the two states.) Therefore, a computer can only understand instructions consisting of series of 0s and 1s. In other words, machine-readable instructions have to be in binary format.
10
What Is C? A computer program written in a high-level language. We have to use some special programs, called compilers or interpreters, to translate such a program into a machine-readable code. The code obtained after the translation is called binary code. Prior to the translation, a program in text format is called source code.
11
QUESTION What are the differences between complier and interpreter?
12
ANSWER A compiler is needed to translate a program written in a compiled language into machine-understandable code (that is, binary code) before you can run the program on your machine. When the translation is done, the binary code can be saved into an application file. You can keep running the application file without the compiler unless the program (source code) is updated and you have to recompile it. The binary code or application file is also called executable code (or an executable file). On the other hand, a program written in an interpreted language can be run immediately after you finish writing it. But such a program always needs an interpreter to translate the high-level instructions into machine-understandable instructions (binary code) at runtime. You cannot run the program on a machine unless the right interpreter is available.
13
The Software We Use for C Programming
14
Stages of Problem Solving Ultimate goal: use a computer to solve a problem Typical stages of building a solution: Clearly specify the problem Analyze the problem Design an algorithm to solve the problem Implement the algorithm (write the program) Test and verify the completed program Maintain and update the program
15
Focus All stages are important In this course, we ignore none of them But we focus on: Algorithm development Writing a program to implement the algorithm
16
The Importance of Practice You wouldn’t expect to learn to play the guitar just by watching a TV series on it There is no substitute for practice. And no one can do it for you The same holds for learning to program
17
Summary In this first lesson you've learned the following: C is a general-purpose programming language. C is a high-level language that has the advantages of readability, maintainability, and portability. C is a very efficient language that allows you to get control of computer hardware and peripherals. C is a small language that you can learn easily in a relatively short time. Programs written in C can be reused. Programs written in C must be compiled and translated into machine-readable code before the computer can execute them. The ANSI standard for C is the standard supported by all C compiler vendors to guarantee the portability of C.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.