Unit II: Introduction to Computing

Table of Contents

1. Art of Programming through Algorithms

An Algorithm is a step-by-step procedure or a set of rules to be followed in calculations or other problem-solving operations. Before writing actual code, programmers use algorithms to define the logic of the program.

Qualities of a Good Algorithm:


2. Flowcharts: Symbols and Rules

A Flowchart is a pictorial or graphical representation of an algorithm. It uses various symbols to represent different types of operations.

Flowchart Symbols:

Symbol Name Shape Purpose
Terminal Oval / Ellipse Indicates the START or END of a program.
Input/Output Parallelogram Used for reading data (Input) or printing results (Output).
Processing Rectangle Used for calculations or data manipulation.
Decision Diamond Represents a condition (Yes/No or True/False branch).
Flow Lines Arrows Indicates the direction of program flow.

Rules for Designing Flowcharts:


3. Overview of C: History and Importance

C is a powerful general-purpose programming language developed by Dennis Ritchie at Bell Laboratories in the early 1970s.


4. Basic Structure and Execution of C

A C program follows a specific template to ensure the compiler can process it correctly.

Basic Structure of a C Program:

  1. Documentation Section: Comments about the program.
  2. Link Section: Header file inclusions (e.g., #include <stdio.h>).
  3. Definition Section: Defining symbolic constants.
  4. Global Declaration Section: Declaring variables used throughout the program.
  5. Main Function: The entry point where execution begins (main() { ... }).
  6. Subprogram Section: User-defined functions.

Executing a C Program:

The execution involves four main steps:

Exam Tips


Frequently Asked Questions

Q1: Why is C called a "middle-level" language?
Because it combines features of high-level languages (human readability) with the power and efficiency of low-level languages (memory manipulation).

Q2: Can a flowchart have multiple start points?
No, a flowchart must have exactly one START terminal to represent the beginning of execution.