TaleemBay
Study
UniversitiesScholarshipsFeesDates
TaleemBay

Empowering students with Next-Gen tools for a brighter future. Your one-stop destination for education in Pakistan.

Quick Links

  • Universities
  • Study Center
  • Past Papers
  • Date Sheets
  • Results

Support

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service
  • Advertise

Contact Us

  • Arfa Software Technology Park,
    Ferozepur Road, Lahore
  • +92 300 1234567
  • hello@taleembay.com

© 2026 TaleemBay. All rights reserved.

Designed with ❤️ for Pakistan

Home
Unis
Study

Study Center

Overview
9th Class10th Class11th Class12th Class

Resources

Past PapersDate Sheets

Need Notes?

AI-powered search for instant answers.

Chapter 8
computer-science • intermediate 12th

Chapter 8: Getting Started with C

Comprehensive notes for Chapter 8 Getting Started with C. Covers Programming Languages, C History, Turbo C++ IDE, and Program Structure.

Programming Languages

Definition: A set of words and symbols used to write programs. Means of communication between user and computer.

Types:

  • Low Level Language: Close to hardware, far from human language.
    • Machine Language: Native language (0s and 1s). Fast execution, no translator needed, machine dependent, difficult to learn.
    • Assembly Language: Uses mnemonics (English-like words) instead of binary. Needs Assembler. One step higher than machine language.
  • High Level Language: Close to human language (English-like). Machine independent, easy to learn/debug. Needs Compiler/Interpreter. Examples: C, C++, Java, BASIC.

Language Processors (Translators)

Software that converts high-level language programs into machine language.

  • Compiler: Converts whole program into object code at once. Generates error map. Fast execution. (e.g., C Compiler).
  • Interpreter: Converts program line-by-line. Stops at first error. Slower execution. No object code reused. (e.g., BASIC).
  • Assembler: Converts Assembly language code into Machine language.

History and Characteristics of C

History: Developed by Dennis Ritchie at AT&T Bell Labs in 1972. Derived from B language (Ken Thompson). ANSI C standard developed later.

Characteristics:

  • Convenient: Easier than low-level languages.
  • Structured: Modular approach (functions).
  • Machine Independent: Code runs on different processors (Intel, Motorola).
  • Case Sensitive: Distinguishes uppercase/lowercase (e.g., 'A' != 'a').
  • Hardware Control: Can write system software (Drivers, OS).
  • Small Language: Few keywords but powerful.

Turbo C++ IDE

IDE (Integrated Development Environment): A software suite to create, edit, compile, and debug programs (e.g., Turbo C++).

Steps to Prepare C Program:

  1. Create/Edit: Use Text Editor. Save with .c extension.
  2. Save: F2 (Default: NONAME00.CPP). Saved in BIN directory.
  3. Compile: Alt + F9. Converts source code (.c) to object code (.obj). Checks syntax errors.
  4. Link: Links object code with library files (.lib). Creates executable file (.exe).
  5. Load: Loader places .exe into memory.
  6. Execute: Ctrl + F9. Runs program. Output screen (Alt + F5).

Basic Structure of C Program

Consists of 3 main parts:

  1. Preprocessor Directives: Instructions to compiler before execution. Start with #.
    • #include <header.h>: Includes library files.
    • #define: Defines constants/macros.
  2. Main Function: void main(void) { ... }. Execution starts here. Essential for every C program.
  3. Program Body (C Statements): Enclosed in braces { }. Statements end with semicolon ;. Case sensitive.

Types of Errors in C

  • Syntax Error: Violation of language rules (e.g., missing semicolon). Detected by compiler.
  • Logical Error: Poor logic (e.g., wrong formula). Program runs but gives wrong output. Most difficult to find.
  • Runtime Error: Illegal operation during execution (e.g., divide by zero). Program crashes.
Download PDFPDF