Introduction

What is a computer program ?

  • A computer program is a set of instructions given to computer to achieve a specific goal.
  • The process of writing a computer program is generally referred as programming.
  • Programming is considered to be a skill, that needs a certain kind of intelligence.
  • This intelligence can be acquired by practice and following certain design principles.

What is a programming language ?

  • We generally interact with a computer using an Operating System (which acts as interface between user and the computer hardware)
  • Operating System uses System Software to provide an environment to the user to solve problem and run the Application Software.
  • As we know computer can only understand binary instructions. However, writing binary instruction for the computer is tedious and inefficient for any programmer. Hence, the programmer takes help of an language which can later be converted or linked to a piece of binary instruction that can interact with computer in desired way. These languages are called programming languages.

What is C?

  • C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972.
  • Why it is called as "C"?
    • The programming language is called "C" simply because it comes after an earlier programming language called "B."
    • The B programming language, developed by Ken Thompson, was a precursor to C and was used for various system-related tasks.
    • Dennis Ritchie wanted to improve and extend the B language, hence, he started working on a new language, which he initially referred to as "New B".
    • However, as the language evolved and gained popularity, it was eventually named "C." The name "C" is a tribute to the language's predecessor, B, as it follows the next letter in the alphabet.
  • C is a procedural programming language, which means it follows a structured approach to programming, where a program is divided into functions or procedures.
  • The original development of C was closely tied to the creation of the Unix operating system, which was also developed at Bell Labs.

Key features of the C programming:

  1. Simplicity: C is designed to be a simple and elegant language, with a small set of keywords and features.
  2. Portability: C programs can be written to be highly portable across different platforms and operating systems, making it a popular choice for cross-platform development.
  3. Efficiency: C allows for direct memory manipulation and low-level access to hardware, making it efficient in terms of performance and memory usage.
  4. Modularity: C supports the concept of functions and allows programmers to create modular and reusable code.
  5. Pointers: C provides support for pointers, which are variables that store memory addresses. Pointers allow direct memory manipulation and are essential for tasks like dynamic memory allocation and working with data structures.
  6. Standard Library: C comes with a standard library that provides a set of functions for various operations, such as string manipulation, input/output, and mathematical calculations.

Why Learn C?

  1. Foundation for Programming: C is a procedural programming language with a relatively simple syntax. Learning C provides a solid foundation for understanding fundamental programming concepts, such as variables, data types, control structures (if-else, loops), functions, and memory management. This knowledge can be applied to other programming languages.
  2. Low-Level Programming: C allows you to have direct control over the hardware and memory, making it suitable for system-level programming, embedded systems, and operating system development. Understanding C helps you work closer to the hardware and develop efficient and optimized code.
  3. Portability: C programs can be highly portable, allowing you to write code that can run on various platforms with minimal modifications. This is essential for cross-platform development and embedded systems where resources may be limited.
  4. Performance: C's low-level nature and efficient memory manipulation allow for high-performance programming. Applications with demanding performance requirements, such as games and real-time systems, often rely on C or languages built on top of C (e.g., C++).
  5. Programming Language Design: Learning C can provide insights into how programming languages are designed and implemented. Many modern languages have been influenced by C, and knowing C helps you understand their roots and concepts.
  6. Problem-Solving Skills: C is known for its simplicity and lack of built-in abstractions, which challenges programmers to think critically and develop effective problem-solving skills.

Go to First C Program