Introduction to C Language
Chapter 4: Programming Basics
Unit 1
*CS101 Computer Basic is a small separate course prerequisite for KCS101/KCS201 Programming for Problem Solving – Using C
Chapter 2: Terminology
Chapter 3: Idea of Algorithm
Chapter 4: Programming Basics
- Introduction to C Language
- Basic Structure of C Program
- Writing and executing the first C program
- Errors in C Programming
- Object Code and Executable Code
- Components of C Language
- Standard Input-Output in C Programming
- Fundamental Data Types
- Variables and Memory Locations
- Storage Classes
Unit 2
Chapter 5: Arithmetic Expressions and Precedence
Chapter 6: Conditional Branching
Unit 3
Chapter 7: Iteration and Loops
Chapter 8: Functions
Unit 4
Chapter 9: Arrays, Structure, Union, and Enumeration
Chapter 10: Basic Algorithms and their Complexity Coexistence
Unit 5
Chapter 11: Pointers
Chapter 12: File Handling
Chapter 13: Macros & Command-Line Arguments
Appendix
KCS151/KCS251 PPS Lab Exercise
PPS Previous Year Question Papers
C is a general-purpose, high-level, structured programming language. It was developed by Dennis MacAlistair Ritchie at AT & T Bell Laboratories located in the USA in 1972, and hence he is known as the founder of C. Often C is called a “Middle-Level Programming Language”. It doesn’t mean that C is less powerful but it reflects the capability of C to combine the elements of high-level language with low-level language. C can be used to write an Operating System as well as an Application Software.
History
Initially, C was designed to build utilities and applications for UNIX. Later C was used to re-implement the UNIX operating system. UNIX and all essential UNIX applications have been written in C.
Characteristics & Advantages of C
- C is a robust, general-purpose, imperative programming language that could be efficiently used for a variety of applications such as Operating System, Compilers, Assemblers, Device Drivers, Databases, Games, Enterprise Applications, etc.
- C is a structured programming language. It allows the programmer to break down a complex program into small and easy functions. These functions are reusable codes and make the program easy to understanding. Debugging, testing, and maintenance of these functions are also easy.
- C is one of the early programming languages, but it is still best to learn programming basics. Many later programming languages inherit its rich features. So it is easy to learn other languages after C.
- C is often called a middle-level programming language. With the strength of low-level assembly language such as low-level access to memory, fast execution, etc. it also has the rich features of a high-level language like easy to code, built-in functions, operators, rich libraries and dynamic memory allocation, etc.
- C is a highly portable programming language thus program written in C can run on a variety of computer platforms without or with little modifications.
- C is an extensible programming language, it has the ability to extend itself. We can add our own functions to C libraries.
Limitation and Disadvantages of C
- C is a Procedure Oriented Programming language so that we need to build algorithms as a set of function calls.
- C doesn’t have support for Object-Oriented Programming (OOP) features such as Class, Object, Encapsulation, Inheritance, Polymorphism, etc. C++ (successor of C) was developed for these reasons.
- C doesn’t have strict type checking for variables. A floating-point or character type variable can also acquire the value of an integer.
- C also doesn’t perform run-time type checking. Instead, C performs automatic type conversion at run time.
- C doesn’t support namespace like C++. It is not possible to declare two variables with the same name in the same scope without namespace.