Download presentation
Presentation is loading. Please wait.
Published byPearl Robbins Modified over 9 years ago
1
BY:HIRA FARMAN Course:
2
LECTURE # 02 BY:HIRA FARMAN
3
1. C is a programming language which born at “AT & T’s Bell Laboratory” of USA in 1972. 2. C was written by Dennis Ritchie, that's why he is also called as father of c programming language.Dennis Ritchie 3. C language was created for a specific purpose i.e. designing the UNIX operating system. 4. Most of the programs that run it are written in C. BY:HIRA FARMAN
4
Its use quickly spread beyond Bell Labs in the late 70’s because of its long list of strong features.long list of strong features C evolved from two previous languages, BCPL (Basic Combined Programming Language) and B.Basic Combined Programming LanguageB BCPL developed in 1967 by Martin RichardsMartin Richards It was named C for new language (after B). BY:HIRA FARMAN
5
Designed by Martin Richards (Cambridge) in 1967 BY:HIRA FARMAN
6
Dennis Ritchie is known as father of c language. BY:HIRA FARMAN
8
Born on September 9 1941 Born inBronxvilleBronxville – New York(united states) Full NameDennis MacAlistair Ritchie NicknameDMR NationalityAmerican Graduate FromHarvard University Graduate InPhysics and Applied Mathematics Webpagehttp://cm.bell-labs.com/who/dmr/ Dead OnOctober 12,2011 BY:HIRA FARMAN
9
1Creator of C Programming 2Creator of UNIX operating System 3 Author of “The C Programming Language” NO WHAT? BY:HIRA FARMAN
10
YEARAWARD 1982 Ritchie and Ken Thompson jointly received the Turing Award for their development of generic operating systems theoryKen Thompson 1999 Thompson and Ritchie jointly received the 1998 National Medal of Technology from President Bill Clinton for co- inventing the UNIX operating system and the C programming language BY:HIRA FARMAN
14
“Though this great Scientist have provided us such strong platform for development of programming language free” BY:HIRA FARMAN
15
Why ‘C’ seems so popular? BY:HIRA FARMAN
16
Reliable. Simple. Easy to use. Produce efficient code. Great Data types BY:HIRA FARMAN
18
Many programs & applications are written in C. Most of the things you learn with C will be directly transferable to future programming languages. Programs that are created with C run very quickly. BY:HIRA FARMAN
19
Major parts of popular operating systems like Windows, UNIX, Linux is still written in C. It is easier to convert a C program to run on a different machine than it is to convert programs written in most other languages. Has strongly influenced many other languages. Pascal, Fortran, java, C++,etc. BY:HIRA FARMAN
20
C provides: Efficiency High performance and high quality small size code Provide functionality through rich set of function libraries. BY:HIRA FARMAN
21
System software Compilers, Editors, embedded systems Graphics and Computational geometry. Operating systems, Also used in many application programs. Gaming Record maintenance BY:HIRA FARMAN
22
C is not object oriented! o Can’t “hide” data as “private” or “protected” fields o You can follow standards to write C code that looks object- oriented, but you have to be disciplined – will the other people working on your code also be disciplined? C has portability issues o Low-level “tricks” may make your C code run well on one platform – but the tricks might not work else where. The compiler and runtime system will rarely stop your C program from doing stupid/bad things o Compile-time type checking is weak BY:HIRA FARMAN
25
C older programming language that is described as Hands-on. As the programmer you must tell the program to do everything. It does not support object oriented code. Thus no classes. In c data is not secured. c follows top down approach BY:HIRA FARMAN
26
C++ - an extension language of C. In C code ++ means increment 1. Thus C++ is better than C. It allows for highly controlled object oriented code. Once again a very hands on language that goes into much detail. Data is hidden secured language. C++ follows bottom up approach. BY:HIRA FARMAN
27
C# - Full object oriented code resembling the style of C/C++ code. This is really closer to JAVA. C# is the latest version of the C style languages and is very good for developing web applications. BY:HIRA FARMAN
28
Programming languages are described in levels: ◦ Low-level programming: close to machine code. ◦ high-level programming : closer to natural languages. BY:HIRA FARMAN
29
C system consists of 3 parts. 1. Environment 2. Language 3. C standard Library Development environment has 6 phases. 1. Edit 2. Preprocessor 3. Compile 4. Link 5. Load 6. Execute BY:HIRA FARMAN
32
Assume that you want to make a quick visit from your classroom to the cafeteria, which is located in the basement. Having understood the task, we would need to work out the steps involved, before actually performing this task. The steps would look as shown below: BY:HIRA FARMAN
33
STEP 1: Leave the room(source) STEP 2: Head towards the staircase STEP 3: Go down to the basement STEP 4: Head for the cafeteria(destination) BY:HIRA FARMAN
34
Such a set of steps is called an algorithm (also called an ‘algo’ for short). An algorithm can be defined as a procedure, formula, or recipe for solving a problem. It consists of a set of steps that help to arrive at a solution. (step by step work) BY:HIRA FARMAN
36
A flowchart is a graphical representation of an algorithm. It charts the flow of instructions or activities in a process. Each such activity is shown using symbols. BY:HIRA FARMAN
37
Type a program Save it Compile the program – This will generate an exe file (executable) Run the program (Actually the exe created out of compilation will run and not the.c file) In different compiler we have different option for compiling and running. We give only the concepts. BY:HIRA FARMAN
38
There are at least three kinds of errors that you can encounter when writing computer programs: 1. Syntax errors 2. Runtime errors 3. Logic errors BY:HIRA FARMAN
39
Syntax or format errors are a major problem for most beginning programmers using languages such as C++, Java, and C#. A syntax error occurs when the programmer fails to obey one of the grammar rules of the language. Typically this involves things like using the wrong case, putting punctuation where it is not supposed to be, failing to put punctuation where it is supposed to be, etc. BY:HIRA FARMAN
40
A runtime error occurs whenever the program instructs the computer to do something that it is either incapable or unwilling to do. Since there are a near infinite number of things that fall in this category. BY:HIRA FARMAN
41
Logic errors are usually the most difficult kind of errors to find and fix, because there frequently is no obvious indication of the error. Usually the program runs successfully. It simply doesn't behave as it should. In other words, it simply doesn't produce the correct answers. BY:HIRA FARMAN
42
Logic errors usually result from one or some combination of the following three causes: 1. You didn't understand how the program is supposed to behave. 2. You didn't understand the behavior of each operation that you wrote into the program. 3. You were careless.
43
THE END QUESTIONS ARE GAURANTEED IN LIFE ANSWERS AREN’T
44
1. Differentiate syntax error and logical error? 2. Why c is dangerous? 3. why c seems so popular? 4. Write 6 phases of C-programs? 5. Discuss Integrated development environment? (Read turbo c book page # 02) BY:HIRA FARMAN
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.