Docsity

A Comprehensive Introduction to 'C' Programming and Procedural Programming Fundamentals, Summaries of Computer science

Partial preview of the text

Download A Comprehensive Introduction to 'C' Programming and Procedural Programming Fundamentals and more Summaries Computer science in PDF only on Docsity!

2026 Edition

Module 1 :

Introduction to 'C'

Welcome to Module 1^2026 Edition

In this module we will take our first step into the world of 'C' programming, one of the most

important and widely used programming languages. 'C' is a powerful, structured and efficient

language that provides a strong foundation for learning other programming languages and

advanced concepts in computer science.

We will begin by understanding what 'C' is, its history, features, applications, and

advantages. You will also learn about the basic structure of a 'C’ Program, how a ā€˜C' Program

is written.

By the end of this module, you will have a clear understanding of the fundamentals of 'C' and

will be ready to write and execute your first ā€˜C’ program.

Let’s begin our journey into 'C' programming.

2026 Edition

Language vs Package

Language Package

  1. A computer language is a set of rulesand symbols^ A package is a way to carry a group ofrelated software and support files.

Language consists of syntax rules and semantics.

It is a collection of related classes, functions, programs and other components under a common name.

  1. Language is a tool that is used to writecomputer program^ Example – java.util ,PHP packagecontain related classes and libraries
  2. Way of communication to computer
  3. Example – 'C', 'C++’, Java, PHP

2

2026 Edition

ā€˜C’ as a middle level Language

•'C' is called a middle level language because it bridges the gap between low-level (machine) languages and high-level (human-readable) languages. It combines the close hardware control and memory access of assembly language with the structured, easy to read syntax and portability of high languages.

  • Low level features in 'C'
  1. Direct memory access : Uses pointers to manipulate memory addresses and bytes directly.
  2. Hardware interaction : Supports bitwise operations to manage registers and device components.
  3. System programming : Powerful enough to write core operating systems and device drivers.
  • High level features in 'C'
  1. Readable syntax : Uses simple control syntax like if, for and while loops.
  2. Portability : Code can run on different computer architectures with little or no change.
  3. Modular structure : Supports functions and code blocks that make complex logic easier to manage.

3

2026 Edition

Procedural Programming

•A procedural programming language is one that uses sets of functions and commands to complete actions. Many programming languages use the procedural programming paradigm, including BASIC, 'C' and Pascal. •Predefined functions, local variables, global variables, parameter passing, modularity and top-down approach are the important pillars of procedural programming. Predefined functions •A predefined function is a function available in a procedural programming language from a library of available functions. •These functions allow a programmer to complete common tasks without creating the required code themselves. This can help a developer save time during production. Local variables •A local variable is a programming variable that has a local scope of use. •This means the variable only functions in the function in which the developer defines it. •Local variables only work in this capacity. If a professional or user attempts to use the variable in a method outside of its scope, it can cause code to fail, leaving a task unfinished

5

2026 Edition

Cont…

Global variables •Global variables increase functionality when local variables are insufficient. •Developers can use global variables in nearly all functions. •When defined globally, a variable makes itself available to all methods and functions in the code. This allows the developer to access key data throughout the program's many procedures. Parameter passing •Parameters are the data values that are transfer from each function within a code sequence. •When using parameter passing, developers place input parameters into a module or device and receive output parameters in return. •Parameters allow a programmer to assign passed data to variables, equations and commands within a function to complete computing actions on the data.

6

2026 Edition

Advantages of 'C'

1. Simple : 'C' is a simple language as it offers a structured approach to solve problems. It also has a rich set of library functions and data types. 'C' is usually taught as an introductory programming language as it is a well-established fact that it becomes easier to learn any other programming language if a person already knows the 'C' language. 2. Portable : 'C' programs can be written on one platform and can be executed in the same way on another operating system. 'C' is a machine-independent language. 3. Structured programming language : 'C' provides different functions that enable to break the code into small parts, that is why 'C' programs are easy to understand and modify. Functions also offer code reusability. 4. Fast and Efficient : Other programming languages, such as Python and Java offer more features than 'C' language but their performance rate gets down due to additional processing. 'C' programming language provides programmers access to direct manipulation with the computer hardware. The compilation and execution time of the 'C' language is also fast. 5. Extensible : 'C' programming can easily adopt new features. 6. Helps understand the fundamentals of Computer Theories : Many computer theories like operating systems, computer networks, compiler designing, and computer architecture are based on the 'C' programming language and need a good knowledge of 'C' programming to work on them. 8

Applications of 'C'^2026 Edition

Some of the applications of 'C' are -

  1. Operating systems
  2. Embedded systems
  3. Compilers
  4. Device drivers
  5. System software
  6. Games and applications

9

Practice Questions^2026 Edition

  1. What are the advantages and applications of language ā€˜C’?
  2. Why the ā€˜C’ language is known as middle level language?
  3. Write a short note on Features of ā€˜C’.
  4. Define Procedural Programming. What are the important features of it?
  5. Define the basic structure of a ā€˜C’ program. Write a program to print ā€œHello Teacherā€ on the screen. Note : Follow the steps in the example