SlideShare a Scribd company logo
Introduction to Programming & C
Md. Rakibuzzaman Khan Pathan
Lecturer, CSE Dept.
City University, Bangladesh.
CSE-113: Structured Programming Language
Learning Objectives
• Programming Language.
• Level of Programming Language.
• Evolution of C.
• Algorithm, Flowchart ,Pseudo Code, ASCII & Scan code.
• Compiler & Interpreter.
What is Programming Language
• A set of instructions and data are together said a program.
• A programming language is a set of rules that provides a way of telling
a computer what operation to perform.
• This program may be designed using any of the computer languages
by a programmer.
• This program is not directly understood by the computer machine.
Therefore, compiler or interpreter is used to translate the
programmers code into a code that is understood by the computer.
Level of Programming Languages
• Low-level Language.
a) Most basic(Machine-level) language.
b) These languages are very similar to the machine code.
c) Collection of very detailed instruction set.
d) Controls computer’s internal circuitry.
e) Very difficult to understand and implementation for general user.
f) Offer better machine efficiency.
Example: Assembly language, Machine Language.
Level of Programming Languages
• High-Level Language.
a) Easily to understand by general users.
b) Very similar to the human language.
c) Program must be translated into machine code before execution.
d) Offer better programming efficiency
Example: Pascal, C, Java, Basic etc.
Procedural Programming VS Structured Programming
• Procedural: Generally flows from one statement to the next, with
occasional jumps and loops handled with goto statements. As the
amount of code and complexity increases, the end result is code that
is extremely difficult to read and maintain, known as spaghetti code.
Assembly language and the resultant machine code are both
examples of procedural languages.
• Structured :Introduces looping structures (for, while, do…while) with
orderly breaks, and procedure calls which allow code to branch and
return to the caller, rather than simply jump to arbitrary code never
to return. There is much less need for goto statements which
ultimately makes code that much easier to read and easier to
maintain.
Why is C called a structured programming language?
• C is called a structured programming language because to solve a
large problem, C programming language divides the problem into
smaller modules called functions or procedures each of which
handles a particular responsibility. The program which solves the
entire problem is a collection of such functions.
Evolution of C
1960 COBOL, FORTRAN:
Problem: They were for special purpose. Such as COBOL for commercial
field and FORTRAN for engineering solution.
1960: People started to think to develop such a language which can
apply for all the possible application rather than so many language. For
this purpose, an international committee was set up.
They come out with a new language called ALGOL 60.
Problem: ALGOL 60 was too abstract and too general.
Evolution of C
1963 : Another new language called CPL(Combined Programming Language)
was developed at Cambridge University.
Problem: Hard to learn and very difficult to implement.
1967: Martin Richard developed another language, called BCPL(Basic
Combined Programming Language).
Problem: Less powerful and too specific.
1970: Around this time, a language called B was written by Ken Thompson at
AT&T Bell Labs.
Problem: Also specific as BCPL.
1972: Denis Ritchie at AT&T Bell Labs inherited the features of BCPL and B
with some other new features from his own and developed C language.
Why Learn C
• Compact, fast and powerful.
(Compact- consisting of parts that are positioned together closely or in a tidy way, using very little space).
 Structured programming language – a disciplined approach to write programs that are clear and easily modified.
 “Mid-level” language.
[High level language have been designed to give a better programming efficiency, where the low-level languages give good
machine efficiency.
C gives both. For this reason, C is often called a Middle-level language.]
 Standard for program development.
 Useful for all applications.
 C is the native language of UNIX.
 Friendly, reliable, simple and easy to use.
 Support Modular Programming style.
Algorithm
Algorithm: An algorithm is a set of rules or steps to solve a mathematical problem
or a computer program. Algorithm describes how people realize a problem, find a
right way to solve it, analyze the data, make an optimal solution and finally output
the result.
Properties of good algorithm :
1) It should be as simple as possible.
2) Steps must be unambiguous so that computer understands the steps properly.
3) It should be understood by others.
4) It must be effective to solve the required problem.
5) It should be able to find an optimal solution.
6) It should have the capability to handle some unexpected situation during
problem solving.
Algorithm
Example: You are given the value of radius of a circle. Find its area.
1. Input radius.
2. If radius is less than 1, then go to step 1.
3. Calculate area: area= 3.14159*radius*radius.
4. Print the value of area.
5. Stop.
Flowchart
Flowchart:
A flowchart(also called “flow diagram” or “flow sheet”) is a diagram
which graphically describe the movement or action of a complex
activity. It is called a flowchart since it charts the flow of a program.
Some specified graphical shapes(such as rectangle, oval, diamond etc.)
are used to represent a flowchart.
Flowchart
Flowchart
Example:
Pseudo code
Pseudo code:
Pseudo code is an alternative of flowchart. It allows the
programmer to describe the solution of a problem which may look
plain English. The reason for pseudo code is to represent the solution
to anybody without programming difficulties. As it is easy to implement
and understand. Many programmer’s represent their solution using
pseudo code, rather than flowchart.
Pseudo code
Example:
If student's grade is greater than or equal to 60
Print "passed"
else
Print "failed"
ASCII & Scan code
ASCII code: ASCII stands for American Standard Code for Information
Interchange. Computers can only understand numbers, so an ASCII
code is the numerical representation of a character such as 'a' or '@'
etc.
This code is basically used for identifying characters and numerals in a
keyboard. these are 8 bit sequence code and are used for identifying
letters, numbers and special characters.
ASCII code
Scan code
Scan code: When we press a key from the keyboard, the PC keyboard
does not generate the ASCII code for that character. Instead, each time
a key is pressed, the keyboard generates a value that corresponds to
that key’s position. This value is called scan code. By generating scan
codes, instead of ASCII code, it is possible for the operating system to
translates those codes into any form it needed.
All the keys of the keyboard has a unique scan code. But, there are
several keys which has no ASCII value.
Compiler and Interpreter
A compiler or Interpreter is a code converter used to convert our hand-
written program (source code) into a corresponding machine
code(object code). Each of the computer languages has its own
Compiler or Interpreter.
Main difference between Compiler and Interpreter is that, Compiler
translates the entire program into machine code and then begin to
execute its instruction. But the interpreter translates each instruction
before execute it.
Compiler and Interpreter
Questions
1) Briefly describe the importance of C.
2) What is an algorithm? Write the properties of a good algorithm.
3) Why C is called “Mid-level” language?
4) What do you mean by ASCII code and Scan code?
5) What is a flowchart? Describes the symbol of flowchart.
6) What is pseudo code?
7) Difference between Compiler and Interpreter.
Questions
From the following, which one is correct and which one is wrong .If wrong,
why?
1. C is a good example of low-level language.
2. High-level language are easily understandable to general users.
3. C is a special purpose language.
4. C is the most widely used programming language in the world.
5. C provides full control to the programmer and makes him independent.
6. C use interpreter to convert user program into machine code.
7. C is a case sensitive language.
Fill in the blanks
1. A computer program is consists of a …… and ……
2. ….. is a statement that specifies an operation to be performed by a
system.
3. …… language are most basic or machine level languages.
4. C was developed by …… at AT&T Bell Labs in …….
5. C was developed inheriting the features of previous two languages
called …… and ……

More Related Content

PDF
Introduction to compilers
PDF
C Language
PPSX
Programming Fundamental Presentation
PPTX
Basic programming concepts
PPT
Programming assignment help
PPTX
Programming Language
PPTX
Introduction To Computer Programming
PPT
Basic Programming Concept
Introduction to compilers
C Language
Programming Fundamental Presentation
Basic programming concepts
Programming assignment help
Programming Language
Introduction To Computer Programming
Basic Programming Concept

What's hot (20)

PDF
Programing paradigm & implementation
PPT
SD & D Types of programming language
PPTX
Chapter 5
PPTX
Introduction to c language
PDF
Principles of-programming-languages-lecture-notes-
PPT
Programming languages
PPT
Introduction to c_language
PPT
Fundamentals of Programming Chapter 2
PPTX
Coding vs programming
PPTX
PDF
Programming languages and concepts by vivek parihar
PPTX
Programming language
PPSX
Introduction of c language
PDF
notes on Programming fundamentals
PPT
Computer Programming - Lecture 1
PPTX
Algorithms - Introduction to computer programming
PPTX
Programming landuages
PPTX
Language translator
PPT
13 A Programing Languages (IT) Lecture Slide
PPT
Programming Languages An Intro
Programing paradigm & implementation
SD & D Types of programming language
Chapter 5
Introduction to c language
Principles of-programming-languages-lecture-notes-
Programming languages
Introduction to c_language
Fundamentals of Programming Chapter 2
Coding vs programming
Programming languages and concepts by vivek parihar
Programming language
Introduction of c language
notes on Programming fundamentals
Computer Programming - Lecture 1
Algorithms - Introduction to computer programming
Programming landuages
Language translator
13 A Programing Languages (IT) Lecture Slide
Programming Languages An Intro
Ad

Similar to Introduction to programming c (20)

PDF
Introduction to programming language (basic)
PPTX
Agro informatics centre up State of Lec 6.pptx
PPTX
Computer Programming In C.pptx
PDF
LESSON__1-15 C-PROGRAMMING.p algorithm df
DOCX
WEBSITE DEVELOPMENT
PPTX
Computer program, computer languages, computer software
PDF
C_Dayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy1.pdf
PPT
Introduction to Computer
PPTX
C programming
PPTX
Introduction to programming
PDF
PPTX
CSE 1201: Structured Programming Language
PPTX
Lecture1.Introduction to Computer programming.pptx
PDF
C programme presentation
PPTX
computer languages
PPTX
Unit 1 CPRsddhcjcjkcjcdjhjkavbasvbasvbkb.pptx
PPTX
Programming in c
PPTX
Programming in C
PPT
Introduction to C Programming - I
Introduction to programming language (basic)
Agro informatics centre up State of Lec 6.pptx
Computer Programming In C.pptx
LESSON__1-15 C-PROGRAMMING.p algorithm df
WEBSITE DEVELOPMENT
Computer program, computer languages, computer software
C_Dayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy1.pdf
Introduction to Computer
C programming
Introduction to programming
CSE 1201: Structured Programming Language
Lecture1.Introduction to Computer programming.pptx
C programme presentation
computer languages
Unit 1 CPRsddhcjcjkcjcdjhjkavbasvbasvbkb.pptx
Programming in c
Programming in C
Introduction to C Programming - I
Ad

Recently uploaded (20)

PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Institutional Correction lecture only . . .
PDF
Classroom Observation Tools for Teachers
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
Insiders guide to clinical Medicine.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
master seminar digital applications in india
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Complications of Minimal Access Surgery at WLH
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Microbial diseases, their pathogenesis and prophylaxis
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
human mycosis Human fungal infections are called human mycosis..pptx
Institutional Correction lecture only . . .
Classroom Observation Tools for Teachers
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Week 4 Term 3 Study Techniques revisited.pptx
Insiders guide to clinical Medicine.pdf
Anesthesia in Laparoscopic Surgery in India
Renaissance Architecture: A Journey from Faith to Humanism
master seminar digital applications in india
Abdominal Access Techniques with Prof. Dr. R K Mishra
Complications of Minimal Access Surgery at WLH
VCE English Exam - Section C Student Revision Booklet
Module 4: Burden of Disease Tutorial Slides S2 2025
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf

Introduction to programming c

  • 1. Introduction to Programming & C Md. Rakibuzzaman Khan Pathan Lecturer, CSE Dept. City University, Bangladesh. CSE-113: Structured Programming Language
  • 2. Learning Objectives • Programming Language. • Level of Programming Language. • Evolution of C. • Algorithm, Flowchart ,Pseudo Code, ASCII & Scan code. • Compiler & Interpreter.
  • 3. What is Programming Language • A set of instructions and data are together said a program. • A programming language is a set of rules that provides a way of telling a computer what operation to perform. • This program may be designed using any of the computer languages by a programmer. • This program is not directly understood by the computer machine. Therefore, compiler or interpreter is used to translate the programmers code into a code that is understood by the computer.
  • 4. Level of Programming Languages • Low-level Language. a) Most basic(Machine-level) language. b) These languages are very similar to the machine code. c) Collection of very detailed instruction set. d) Controls computer’s internal circuitry. e) Very difficult to understand and implementation for general user. f) Offer better machine efficiency. Example: Assembly language, Machine Language.
  • 5. Level of Programming Languages • High-Level Language. a) Easily to understand by general users. b) Very similar to the human language. c) Program must be translated into machine code before execution. d) Offer better programming efficiency Example: Pascal, C, Java, Basic etc.
  • 6. Procedural Programming VS Structured Programming • Procedural: Generally flows from one statement to the next, with occasional jumps and loops handled with goto statements. As the amount of code and complexity increases, the end result is code that is extremely difficult to read and maintain, known as spaghetti code. Assembly language and the resultant machine code are both examples of procedural languages. • Structured :Introduces looping structures (for, while, do…while) with orderly breaks, and procedure calls which allow code to branch and return to the caller, rather than simply jump to arbitrary code never to return. There is much less need for goto statements which ultimately makes code that much easier to read and easier to maintain.
  • 7. Why is C called a structured programming language? • C is called a structured programming language because to solve a large problem, C programming language divides the problem into smaller modules called functions or procedures each of which handles a particular responsibility. The program which solves the entire problem is a collection of such functions.
  • 8. Evolution of C 1960 COBOL, FORTRAN: Problem: They were for special purpose. Such as COBOL for commercial field and FORTRAN for engineering solution. 1960: People started to think to develop such a language which can apply for all the possible application rather than so many language. For this purpose, an international committee was set up. They come out with a new language called ALGOL 60. Problem: ALGOL 60 was too abstract and too general.
  • 9. Evolution of C 1963 : Another new language called CPL(Combined Programming Language) was developed at Cambridge University. Problem: Hard to learn and very difficult to implement. 1967: Martin Richard developed another language, called BCPL(Basic Combined Programming Language). Problem: Less powerful and too specific. 1970: Around this time, a language called B was written by Ken Thompson at AT&T Bell Labs. Problem: Also specific as BCPL. 1972: Denis Ritchie at AT&T Bell Labs inherited the features of BCPL and B with some other new features from his own and developed C language.
  • 10. Why Learn C • Compact, fast and powerful. (Compact- consisting of parts that are positioned together closely or in a tidy way, using very little space).  Structured programming language – a disciplined approach to write programs that are clear and easily modified.  “Mid-level” language. [High level language have been designed to give a better programming efficiency, where the low-level languages give good machine efficiency. C gives both. For this reason, C is often called a Middle-level language.]  Standard for program development.  Useful for all applications.  C is the native language of UNIX.  Friendly, reliable, simple and easy to use.  Support Modular Programming style.
  • 11. Algorithm Algorithm: An algorithm is a set of rules or steps to solve a mathematical problem or a computer program. Algorithm describes how people realize a problem, find a right way to solve it, analyze the data, make an optimal solution and finally output the result. Properties of good algorithm : 1) It should be as simple as possible. 2) Steps must be unambiguous so that computer understands the steps properly. 3) It should be understood by others. 4) It must be effective to solve the required problem. 5) It should be able to find an optimal solution. 6) It should have the capability to handle some unexpected situation during problem solving.
  • 12. Algorithm Example: You are given the value of radius of a circle. Find its area. 1. Input radius. 2. If radius is less than 1, then go to step 1. 3. Calculate area: area= 3.14159*radius*radius. 4. Print the value of area. 5. Stop.
  • 13. Flowchart Flowchart: A flowchart(also called “flow diagram” or “flow sheet”) is a diagram which graphically describe the movement or action of a complex activity. It is called a flowchart since it charts the flow of a program. Some specified graphical shapes(such as rectangle, oval, diamond etc.) are used to represent a flowchart.
  • 16. Pseudo code Pseudo code: Pseudo code is an alternative of flowchart. It allows the programmer to describe the solution of a problem which may look plain English. The reason for pseudo code is to represent the solution to anybody without programming difficulties. As it is easy to implement and understand. Many programmer’s represent their solution using pseudo code, rather than flowchart.
  • 17. Pseudo code Example: If student's grade is greater than or equal to 60 Print "passed" else Print "failed"
  • 18. ASCII & Scan code ASCII code: ASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as 'a' or '@' etc. This code is basically used for identifying characters and numerals in a keyboard. these are 8 bit sequence code and are used for identifying letters, numbers and special characters.
  • 20. Scan code Scan code: When we press a key from the keyboard, the PC keyboard does not generate the ASCII code for that character. Instead, each time a key is pressed, the keyboard generates a value that corresponds to that key’s position. This value is called scan code. By generating scan codes, instead of ASCII code, it is possible for the operating system to translates those codes into any form it needed. All the keys of the keyboard has a unique scan code. But, there are several keys which has no ASCII value.
  • 21. Compiler and Interpreter A compiler or Interpreter is a code converter used to convert our hand- written program (source code) into a corresponding machine code(object code). Each of the computer languages has its own Compiler or Interpreter. Main difference between Compiler and Interpreter is that, Compiler translates the entire program into machine code and then begin to execute its instruction. But the interpreter translates each instruction before execute it.
  • 23. Questions 1) Briefly describe the importance of C. 2) What is an algorithm? Write the properties of a good algorithm. 3) Why C is called “Mid-level” language? 4) What do you mean by ASCII code and Scan code? 5) What is a flowchart? Describes the symbol of flowchart. 6) What is pseudo code? 7) Difference between Compiler and Interpreter.
  • 24. Questions From the following, which one is correct and which one is wrong .If wrong, why? 1. C is a good example of low-level language. 2. High-level language are easily understandable to general users. 3. C is a special purpose language. 4. C is the most widely used programming language in the world. 5. C provides full control to the programmer and makes him independent. 6. C use interpreter to convert user program into machine code. 7. C is a case sensitive language.
  • 25. Fill in the blanks 1. A computer program is consists of a …… and …… 2. ….. is a statement that specifies an operation to be performed by a system. 3. …… language are most basic or machine level languages. 4. C was developed by …… at AT&T Bell Labs in ……. 5. C was developed inheriting the features of previous two languages called …… and ……