0% found this document useful (0 votes)
25 views3 pages

Introduction to C Programming Basics

This document provides an introduction to C programming, including: 1. It defines algorithms, digital computers, and their basic components like CPU, memory, and input/output devices. 2. It explains the differences between system software and application software, and defines a computer program as data and instructions for manipulating the data. 3. It outlines the different types of programming languages from low-level like machine language to high-level languages like C++, and provides a brief history of the C programming language.

Uploaded by

Nympha Lachaona
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views3 pages

Introduction to C Programming Basics

This document provides an introduction to C programming, including: 1. It defines algorithms, digital computers, and their basic components like CPU, memory, and input/output devices. 2. It explains the differences between system software and application software, and defines a computer program as data and instructions for manipulating the data. 3. It outlines the different types of programming languages from low-level like machine language to high-level languages like C++, and provides a brief history of the C programming language.

Uploaded by

Nympha Lachaona
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction to C Programming Handout #1: Introduction

Handout #1
Introduction

Electronic Data Processing Concepts

IPO Diagram

Input Process Output

Algorithm (from "Fundamentals of Data Structures", by Horowitz & Sahni)

An algorithm is a finite set of instructions which, if followed, accomplish a particular task. In addition,
every algorithm must satisfy the following criteria:

1. Input: there are zero or more quantities which are externally supplied
2. Output: at least one quantity is produced
3. Definiteness: each instruction must be clear and unambiguous
4. Finiteness: if we trace the instructions of an algorithm, then for all cases, the algorithm will
terminate after a finite number of steps
5. Effectiveness: every instruction must be sufficiently basic that it can in principle be carried out by a
person using only pencil and paper. It is not enough that each operation be definite, but it must also
be feasible.

Digital Computer

A digital computer is a machine (also called hardware) that is capable of storing data and executing
algorithms. It is made up of the following physical components

1. Central Processing Unit (CPU)


2. Memory
2.1 Primary Memory
Read Only Memory (ROM)
Random Access Memory (RAM)
2.2 Secondary Memory
Includes magnetic, hard disk, floppy diskette, ZIP disk, CD-ROM
3. Input/Output Devices (I/O)
3.1 Input devices include keyboard, mouse, touchpad etc.
3.2 Output devices include display screen, printer, plotter

Software

In loose terms, software refers to computer programs which serve as interface between the user and the
hardware. Software can be categorized into two, namely:

1. System Software
- including operating system, compilers, linkers etc.

1
Introduction to C Programming Handout #1: Introduction
2

2. Application Software
- including word processor, spreadsheet, calculator etc.

What is a computer program?

A computer program is very much like an algorithm. However, it may not be finite, i.e., a program need
not terminate after a finite number of steps. An example of such a program is an operating system.

Basically, a computer program is made up of two components:


1. Data
2. Instructions for manipulating data

A computer program is written using a certain computer programming language.

Computer Programming Language

A programming language describes the:


1. vocabulary (set of symbols and words)
2. syntax (rules)
3. semantics (meaning)
that are used to write a valid computer program.

Types of Computer Programming Languages

1. Low-Level Languages
Low-level languages include:
- machine language (lowest level, defined in terms of zero's and one's)
- assembly language (uses mnemonics)
They are called low-level because they require the programmers to have a good
understanding of the underlying hardware for which the programs are intended to run
Programs written using low-level languages are not portable, i.e. they cannot be executed
in two different and incompatible processors

2. High-Level Languages
High-level languages include:
- FORTRAN
- ALGOL
- COBOL
- PL/1
- BASIC
- Pascal
- C++
- Java
They are called high-level because (1) the language is quasi-English and (2) it does not
require the programmer to know the actual computer hardware
The programs written in high-level languages are able to exhibit portability

The C Programming Language

The C programming language is a general-purpose programming language.


It is mainly associated with systems programming, but theoretically it can be used for
programming in different domains including scientific and business applications.
It was developed by Dennis Ritchie (one of the authors of "The C Programming Language" book).

2
Introduction to C Programming Handout #1: Introduction
3

Evolutions of C is as follows:

BCPL 1967 (Martin Richards)

B 1970 (Ken Thompson)

C 1972 (Dennis Ritchie)

ANSI C 1989

C++ 1990 (Bjourne Stroustrup)

Common questions

Powered by AI

Finiteness in an algorithm ensures that the execution will complete after a specific number of steps, providing a clear endpoint. This is crucial for tasks as it guarantees resources are not consumed indefinitely, making it feasible for a user or a system with limited resources to execute the tasks efficiently and predictably .

The CPU, or Central Processing Unit, is the primary component of a digital computer responsible for executing instructions and processing data. It interacts with memory to retrieve and save data, performs logic and arithmetic operations, and communicates with input/output devices to handle data input and output tasks. The CPU's efficiency and speed significantly affect the overall performance of the computer .

System software serves as an interface between hardware and user applications, managing resources like the operating system, compilers, and linkers. It provides essential services for application execution, ensuring efficient hardware management. In contrast, application software, such as word processors and spreadsheets, aims to solve specific user problems by utilizing system software to perform tasks and execute user commands .

High-level programming languages abstract hardware details by providing quasi-English syntax and semantics, which ease the process of software development. This abstraction allows programmers to focus on problem-solving and application logic without delving into the intricate specifics of hardware architecture, thereby enhancing portability across different hardware systems .

Definiteness in algorithms ensures that each instruction is clear and unambiguous, facilitating consistent execution regardless of the programmer or the environment. This clarity is vital for debugging and maintaining programs, as it prevents misinterpretation and inconsistencies in how the program operates, thus improving reliability and predictability in outcomes .

The evolution from BCPL to ANSI C brought about a more structured and efficient way of programming with features such as data types and control structures, which improved code readability and reliability. ANSI C standardized the C language, which enhanced portability and interoperability across different systems and laid the groundwork for subsequent languages like C++, promoting better program design and object-oriented programming practices .

Semantics in a programming language define the meaning of various syntactical constructs. It is crucial for ensuring program correctness, as it dictates how expressions are evaluated and what actions are executed, directly affecting the logical flow and outcomes of a program. Understanding semantics ensures that the program behaves as intended and meets user requirements .

Portability is a key advantage of high-level languages because it allows programs to run on various types of hardware without modification, unlike low-level languages that are tightly coupled to specific hardware architectures. This characteristic reduces time and cost for software development, as the same codebase can be reused and executed across multiple systems, thereby enhancing software usability and distribution .

Effectiveness is crucial for algorithms because it ensures that each instruction can be executed practically, often requiring only basic tools like pencil and paper by a person. This assures the feasibility of implementation and testing, which is essential for ensuring the algorithm can solve the problem in real-world applications without specialized tools or resources .

A programming language is classified as low-level because it closely represents the machine's native language, typically having minimal abstraction from hardware. These languages often require detailed hardware knowledge and provide direct control over memory and processor instructions. Despite their complexity, they are used for performance-critical tasks where finer control over hardware is necessary, such as in embedded systems and operating system development .

You might also like