Unit 1: Problem Solving with Computer [2 Hours]
Problem solving with a computer means understanding a problem, designing a logical solution, converting that solution into a program, and checking that the program works correctly. This unit covers the complete path from problem analysis and algorithm design to coding, compilation, execution, debugging, testing, and documentation. It also introduces the development of the C programming language and the standard structure used to organize a C program.
Tested Topics
- Compilation process: source code vs object code — 1x (2080)
- Debugging & testing — 1x (2081)
- History of C — 1x (2078)
- Structure of a C program — 1x (2078)
1.1 Problem Analysis
Definition
Problem analysis is the process of studying a problem carefully to determine what is given, what result is required, and what steps are needed to obtain that result.
Before writing a program, the programmer needs to understand exactly what the computer must do. Problem analysis separates the problem into input, processing, and output so that a clear solution can be designed.
Detailed Explanation
Programming should not normally begin by immediately writing statements in C. A programmer first identifies the requirements of the problem. Good analysis reduces confusion during algorithm design and coding.
Main Parts of Problem Analysis
- Identify the problem: understand the task that has to be solved.
- Identify the input: determine the data that must be supplied to the program.
- Identify the required output: determine what result the program must produce.
- Determine the processing: find the calculations, decisions, or operations needed to transform the input into the required output.
- Consider constraints: identify rules or limitations that affect the solution.
The basic relationship is:
Input → Processing → Output
Example
Suppose the problem is to calculate the average marks of three subjects.
| Part | Analysis |
|---|---|
| Input | Marks of three subjects: m1, m2, and m3 |
| Processing | total = m1 + m2 + m3; average = total / 3 |
| Output | Average marks |
Let's Clarify
Consider ordering food through an app. You first choose the items and quantity, the app calculates the total amount, and then it displays the bill. The chosen items are the input, calculation of the bill is the processing, and the final amount is the output. Computer problems are analyzed in the same basic way.
Summary
- Problem analysis determines exactly what a program is expected to do.
- The problem is commonly divided into input, processing, and output.
- Requirements and constraints should be understood before designing the solution.
- A clear analysis becomes the foundation for the algorithm and program that follow.
Test Yourself
- What is problem analysis in computer programming?
- Analyze a problem that calculates the area of a rectangle in terms of input, processing, and output.
Hints:
- It is the process of identifying the problem, required inputs, processing steps, outputs, and constraints before programming.
- Input: length and breadth. Processing: area = length × breadth. Output: calculated area.
1.2 Algorithms and Flowchart
Definition
An algorithm is a finite sequence of clear and ordered steps used to solve a particular problem.
An algorithm describes the logic of a solution before that logic is written in a programming language. It tells us what steps must happen and in what order.
A flowchart is a graphical representation of an algorithm using standard symbols connected by arrows to show the sequence of operations.
Where an algorithm expresses a solution using written steps, a flowchart shows the same logic visually.
Detailed Explanation
After problem analysis, the next task is to design a solution. An algorithm provides this solution in a language-independent form. It can later be translated into C, Java, Python, or another programming language.
Characteristics of a Good Algorithm
- Input: it may accept one or more input values.
- Output: it must produce at least one meaningful result.
- Definiteness: every step must be clear and unambiguous.
- Finiteness: the algorithm must terminate after a finite number of steps.
- Effectiveness: each operation should be practical and executable.
Example Algorithm
Algorithm to add two numbers:
Step 1: Start
Step 2: Read A and B
Step 3: Sum = A + B
Step 4: Display Sum
Step 5: StopThe sequence is:
Start → Read values → Add values → Display result → Stop
Common Flowchart Symbols
| Symbol | Name | Purpose |
|---|---|---|
| Oval | Terminal | Represents Start or Stop. |
| Rectangle | Process | Represents calculation or processing. |
| Parallelogram | Input/Output | Represents reading input or displaying output. |
| Diamond | Decision | Represents a condition with alternative paths such as Yes/No. |
| Arrow | Flow line | Shows the direction in which control moves. |
| Circle | Connector | Connects separated parts of a flowchart. |
Flowchart for Adding Two Numbers
┌─────────┐
│ Start │
└────┬────┘
│
▼
┌─────────────┐
│ Input A, B │
└──────┬──────┘
│
▼
┌─────────────┐
│ Sum = A + B │
└──────┬──────┘
│
▼
┌─────────────┐
│ Display Sum │
└──────┬──────┘
│
▼
┌─────────┐
│ Stop │
└─────────┘Algorithm vs. Flowchart
| Basis | Algorithm | Flowchart |
|---|---|---|
| Form | Written sequence of steps | Graphical representation of steps |
| Representation | Uses statements or pseudocode | Uses standard symbols and arrows |
| Preparation | Usually quicker to write | Requires drawing symbols and connections |
| Modification | Steps can usually be changed easily | Changes may require redrawing part of the chart |
| Visualization | Logic is described textually | Program flow is visible graphically |
Let's Clarify
A recipe and a route map express instructions in different ways. A recipe gives ordered written steps, much like an algorithm. A route map shows the path visually, much like a flowchart. Both can describe the same solution, but their forms are different.
Summary
- An algorithm gives a finite and ordered procedure for solving a problem.
- A flowchart represents algorithmic logic graphically.
- Algorithms should be definite, finite, effective, and capable of producing output.
- Flowcharts use standard symbols for terminals, processes, input/output, decisions, and flow direction.
- Algorithms and flowcharts both help organize program logic before coding begins.
Test Yourself
- Define an algorithm and list its major characteristics.
- What is a flowchart? Explain the common symbols used in a flowchart.
- Write an algorithm to find the greater of two numbers.
Hints:
- An algorithm is a finite sequence of clear steps. Key characteristics include input, output, definiteness, finiteness, and effectiveness.
- A flowchart visually represents an algorithm. Include terminal, process, input/output, decision, flow line, and connector symbols.
- Read A and B → compare A and B → display A if A > B, otherwise display B → stop.
1.3 Coding
Definition
Coding is the process of converting an algorithm or program logic into instructions written in a programming language.
The algorithm explains the solution, while coding expresses that solution using the syntax and rules understood by a programming language such as C.
Detailed Explanation
Coding builds directly on 1.2 Algorithms and Flowchart. Once the required steps are known, each step is translated into suitable program statements.
For example, the algorithm:
Read A and B → calculate A + B → display result
can be coded in C as:
#include <stdio.h>
int main(void)
{
int a, b, sum;
printf("Enter two numbers: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum = %d\n", sum);
return 0;
}Main Activities During Coding
- Select suitable data types: decide how values should be represented.
- Declare variables: create names for the data used by the program.
- Write expressions: translate calculations into programming statements.
- Write control statements: implement decisions and repetitions where required.
- Use input/output statements: accept data and present results.
- Follow language syntax: use the grammatical rules of the chosen programming language correctly.
Common Mistake
Algorithm and code are not the same thing. An algorithm describes the solution independently of a programming language. Code is the implementation of that solution using the syntax of a specific language.
Summary
- Coding translates a designed solution into programming-language statements.
- It normally begins after the problem and algorithm have been clearly defined.
- Correct coding requires proper syntax, data types, variables, expressions, and control statements.
- The resulting human-readable program is called source code.
Test Yourself
- What is coding?
- How is coding related to an algorithm?
Hints:
- Coding is the conversion of program logic into statements written in a programming language.
- The algorithm specifies the logical steps; coding implements those steps using language-specific syntax.
1.4 Compilation and Execution
Definition
Compilation is the process of translating source code written in a high-level programming language into lower-level machine-related code that a computer system can process.
Execution is the stage in which the prepared executable program is loaded and run so that its instructions are actually performed by the computer.
Detailed Explanation
A C program written by a programmer cannot normally be executed directly in its original text form. It must pass through several stages before the computer can run it.
The usual translation sequence is:
Source code → Preprocessing → Compilation → Assembly → Object code → Linking → Executable program → Execution
1. Source Code
Source code is the human-readable program written by the programmer in a programming language such as C. C source files commonly use the .c file extension.
#include <stdio.h>
int main(void)
{
printf("Hello\n");
return 0;
}2. Preprocessing
Before actual compilation, the preprocessor processes directives beginning with #. For example, #include causes required header-file content to be made available for compilation.
3. Compilation
The compiler examines the program and translates the preprocessed C code toward lower-level form. It also detects many errors involving the grammatical rules of C, known as syntax errors.
4. Assembly
The assembler converts assembly-level instructions into machine-code form and produces an object file.
5. Object Code
Object code is machine-level code produced from a source program after translation. It may still contain unresolved references to library functions or other program modules, so it is not necessarily ready to execute by itself.
6. Linking
The linker combines object code with required library code and other object modules. For example, a call to printf() depends on library support that must be connected to the program.
7. Executable Program
After successful linking, an executable program is produced. It contains the machine instructions required to run the program on the target system.
8. Loading and Execution
When the executable is started, the operating system loads it into memory and the processor performs its instructions. During execution, the program may accept input, process data, and generate output.
Source Code vs. Object Code
| Basis | Source Code | Object Code |
|---|---|---|
| Meaning | Program written by the programmer | Machine-level code produced after translation |
| Readability | Human-readable | Not conveniently readable by humans |
| Creation | Created using a text editor or development environment | Generated by translation tools |
| Language form | Uses statements and syntax of C | Uses machine-level binary representation |
| Purpose | Used for writing and maintaining the program | Used as an intermediate machine-level form before or during linking |
| Typical file | Commonly stored in a .c file | Commonly stored in an object file whose extension depends on the system |
Let's Clarify
The programmer writes instructions in a form convenient for humans. The compiler and related tools translate those instructions into forms convenient for the computer. The linker then joins the translated program with anything it depends on. Only after these stages is the completed program ready to run.
Common Mistake
Object code and an executable file are not always the same. Object code can still contain unresolved external references. Linking combines the necessary pieces to create the final executable program.
Summary
- Source code is the human-readable program written by the programmer.
- Compilation and related translation stages convert source code into machine-level form.
- Object code is translated machine-level code that may still need linking.
- The linker combines object modules and required libraries to create an executable program.
- Execution begins when the operating system loads the executable and the processor performs its instructions.
Test Yourself
- Explain the main stages from C source code to program execution.
- What is the role of a linker?
- Differentiate between source code and object code. (2080)
Hints:
- Source code → preprocessing → compilation → assembly → object code → linking → executable → loading and execution.
- The linker combines object modules with required library code and resolves external references to create an executable.
- Source code is human-readable C written by the programmer; object code is machine-level translated code produced before final linking.
1.5 History of C
Definition
C is a general-purpose programming language developed by Dennis Ritchie at Bell Laboratories in the early 1970s.
C grew from earlier programming-language work and became closely associated with the development of the UNIX operating system. Its combination of low-level control and high-level programming constructs helped it become widely used for system and application programming.
Detailed Explanation
Development of C
- BCPL: Basic Combined Programming Language (BCPL), created by Martin Richards, influenced later system-programming languages.
- B language: Ken Thompson developed the B language at Bell Laboratories, influenced by BCPL.
- C language: Dennis Ritchie developed C at Bell Laboratories around 1972 as an improvement over B.
- UNIX: C became strongly associated with UNIX because major parts of the operating system were rewritten in C during the early 1970s.
- K&R C: Brian Kernighan and Dennis Ritchie published The C Programming Language in 1978. The form of C documented there became widely used before formal standardization.
- ANSI C: The American National Standards Institute (ANSI) standardized C in 1989.
- ISO standard: The International Organization for Standardization (ISO) adopted the C standard internationally in 1990.
Why C Became Influential
- It supported efficient system-level programming.
- Programs could be moved between different computer systems more easily than assembly-language programs.
- It provided structured programming features such as functions, loops, and decision statements.
- It influenced many later programming languages, including C++, Java, and C#.
Summary
- C was developed by Dennis Ritchie at Bell Laboratories in the early 1970s.
- Its development was influenced by the earlier BCPL and B languages.
- C became closely connected with the development of the UNIX operating system.
- Kernighan and Ritchie's 1978 book helped establish the widely used early form of C.
- C was standardized by ANSI in 1989 and adopted internationally by ISO in 1990.
Test Yourself
- State who developed C, where it was developed, and which earlier languages influenced it.
- Write short notes on: a. History of C (2078)
Hints:
- Dennis Ritchie developed C at Bell Laboratories in the early 1970s. BCPL and B were important predecessors.
- Cover BCPL → B → C, Dennis Ritchie and Bell Laboratories, the UNIX connection, the 1978 Kernighan-Ritchie book, and later ANSI/ISO standardization.
1.6 Structure of a C Program
Definition
The structure of a C program is the organized arrangement of program elements such as documentation, header inclusion, definitions, declarations, the main() function, and user-defined functions.
A C program does not require every program to look identical, but organizing related elements in a standard order makes the program easier to understand, compile, test, and maintain.
Detailed Explanation
A commonly taught structure of a C program contains the following sections:
- Documentation section
- Link section
- Definition section
- Global declaration section
- main() function section
- Subprogram or user-defined function section
1. Documentation Section
The documentation section contains comments that describe the program, its purpose, author information, assumptions, or other useful details.
/* Program to calculate the area of a circle */Comments are intended for humans and are not executed as program instructions.
2. Link Section
The link section commonly contains header inclusion directives required by the program.
#include <stdio.h>Here, stdio.h provides declarations related to standard input and output facilities used by functions such as printf() and scanf().
3. Definition Section
The definition section contains symbolic constants or macro definitions.
#define PI 3.14159The name PI can then be used in the program instead of repeatedly writing the numeric value.
4. Global Declaration Section
The global declaration section may contain global variables and function declarations that must be visible to multiple functions.
float area(float radius);This line declares the function area() before it is used.
5. main() Function Section
In a hosted C program, program execution begins with the main() function. It normally contains local declarations and executable statements.
int main(void)
{
float radius, result;
printf("Enter radius: ");
scanf("%f", &radius);
result = area(radius);
printf("Area = %.2f\n", result);
return 0;
}The statement return 0; indicates successful termination to the host environment.
6. User-Defined Function Section
Functions created by the programmer can be placed outside main(). These functions perform specific tasks and help divide a large program into manageable parts.
float area(float radius)
{
return PI * radius * radius;
}Complete Example
/* Documentation Section:
Program to calculate the area of a circle
*/
/* Link Section */
#include <stdio.h>
/* Definition Section */
#define PI 3.14159
/* Global Declaration Section */
float area(float radius);
/* main() Function Section */
int main(void)
{
float radius, result;
printf("Enter radius: ");
scanf("%f", &radius);
result = area(radius);
printf("Area = %.2f\n", result);
return 0;
}
/* User-Defined Function Section */
float area(float radius)
{
return PI * radius * radius;
}How the Program Works
Header is included → PI is defined → area() is declared → main() starts → radius is read → area() is called → result is returned → result is displayed → program terminates
Common Mistake
The commonly taught sections describe a useful organizational model, not a rule that every C program must contain every section. A small valid program may have no macro definitions, global variables, or user-defined functions. The required structure depends on what the program needs.
Summary
- A C program is organized into logical sections that separate documentation, declarations, definitions, and executable code.
- The link section commonly contains header inclusion directives, while the definition section contains symbolic definitions.
- The main() function is the starting point of execution in a normal hosted C program.
- User-defined functions divide a larger solution into smaller reusable tasks.
- Not every valid C program needs every commonly taught structural section.
Test Yourself
- Name and explain the commonly taught sections of a C program.
- Why are user-defined functions used in a C program?
- Explain structure of a C program with suitable example. (2078)
Hints:
- Documentation, link, definition, global declaration, main() function, and user-defined function sections.
- They divide a program into manageable tasks, support reuse, and improve organization.
- Explain each structural section and present a complete C program showing comments, #include, #define, declaration, main(), and a user-defined function.
1.7 Debugging
Definition
Debugging is the process of locating, analyzing, and correcting errors or defects in a computer program.
When a program gives the wrong result, stops unexpectedly, or behaves differently from the intended logic, debugging is the work performed to discover the cause and fix it.
Detailed Explanation
Errors found in programs are often called bugs. Debugging begins after an error has been detected and focuses on determining where the error is, why it occurs, and how it should be corrected.
Common Categories of Program Errors
1. Syntax Error
A syntax error occurs when the grammatical rules of the programming language are violated.
printf("Hello")In C, the missing semicolon causes a syntax error.
2. Runtime Error
A runtime error occurs while the program is executing. It may arise from an invalid operation or an environmental condition that prevents normal execution.
3. Logical Error
A logical error occurs when the program runs but produces an incorrect result because its logic is wrong.
average = a + b / 2;If the intended calculation is the average of a and b, the correct expression is:
average = (a + b) / 2;Typical Debugging Process
- Observe the failure: identify the incorrect behavior or error message.
- Reproduce the problem: determine the conditions under which the error occurs.
- Locate the faulty area: narrow the problem to a statement, function, or section of code.
- Determine the cause: understand why the code behaves incorrectly.
- Correct the defect: modify the code.
- Retest: run relevant tests again to confirm the correction works and has not introduced another defect.
Debugging vs. Testing
| Basis | Debugging | Testing |
|---|---|---|
| Meaning | Finding the cause of a defect and correcting it | Executing or evaluating software to detect defects and verify expected behavior |
| Main purpose | Remove a known problem | Discover problems and determine whether requirements are satisfied |
| When performed | Usually after a failure or defect has been identified | Performed systematically throughout development and after changes |
| Activity | Trace, inspect, isolate, and modify code | Provide test cases, compare expected and actual results |
| Result | Corrected program code | Evidence about whether the program behaves as expected |
Let's Clarify
If a calculator program returns 12 when the expected result is 10, testing reveals that the result is wrong. Inspecting the expression, discovering an incorrect operator, and replacing it with the correct one is debugging.
Summary
- Debugging locates the cause of a program defect and corrects it.
- Common program problems include syntax, runtime, and logical errors.
- Effective debugging moves from reproducing the problem to locating, correcting, and retesting it.
- Testing detects incorrect behavior; debugging explains and fixes the underlying defect.
Test Yourself
- What is debugging? Describe its basic steps.
- Give one example each of a syntax error and a logical error.
- Differentiate between debugging and testing. (2081)
Hints:
- Debugging means locating, understanding, correcting, and retesting program defects.
- Syntax: missing semicolon. Logical: incorrect formula such as a + b / 2 instead of (a + b) / 2.
- Testing detects failures and checks behavior; debugging locates the cause of a detected defect and fixes it.
1.8 Testing
Definition
Testing is the process of checking a program with selected inputs and conditions to determine whether it behaves according to its requirements and produces the expected results.
Testing compares what the program should do with what it actually does. When the two differ, a defect may exist.
Detailed Explanation
A program that compiles successfully is not automatically correct. Compilation can detect many language-rule errors, but it cannot guarantee that the program calculates the right result or handles all valid and invalid inputs correctly.
Basic Testing Process
- Define the expected result: determine what correct behavior should look like.
- Select test data: choose input values and operating conditions.
- Execute the program: run it using the selected data.
- Observe the actual result: record what the program produces.
- Compare expected and actual results: determine whether the test passes or fails.
- Report defects: document unexpected behavior for debugging and correction.
- Retest after correction: confirm that the modified program now behaves correctly.
Types of Test Data
| Test Data | Meaning | Example |
|---|---|---|
| Normal data | Ordinary valid input within the expected range | Age = 20 when valid ages are 1 to 120 |
| Boundary data | Input at or very close to the allowed limits | Age = 1 or Age = 120 |
| Invalid data | Input outside the permitted rules or range | Age = -5 |
Example
Suppose a program accepts marks from 0 to 100.
| Input | Category | Expected Behavior |
|---|---|---|
| 65 | Normal | Accept the value |
| 0 | Boundary | Accept the value |
| 100 | Boundary | Accept the value |
| -1 | Invalid | Reject the value |
| 101 | Invalid | Reject the value |
Common Mistake
A program passing one normal input does not prove that it works correctly for all cases. Boundary and invalid inputs can expose defects that ordinary test values do not reveal.
Summary
- Testing checks whether actual program behavior matches expected behavior.
- Successful compilation does not guarantee logical correctness.
- Testing commonly includes normal, boundary, and invalid data.
- A failed test reveals incorrect behavior that can then be investigated through debugging.
- Programs should be retested after defects are corrected.
Test Yourself
- What is software testing?
- Explain normal, boundary, and invalid test data with examples.
- Why should a program be tested even after it compiles successfully?
Hints:
- Testing checks program behavior using selected inputs and compares actual results with expected results.
- Normal = ordinary valid input; boundary = input at the permitted limits; invalid = input outside permitted rules.
- Compilation mainly checks translation and language-related correctness. Logical errors can remain even when compilation succeeds.
1.9 Documentation
Definition
Documentation is the written information that describes a program, its design, operation, usage, and maintenance.
Documentation helps programmers, users, and maintainers understand what the software does, how it works, and how it should be used or modified.
Detailed Explanation
Software may continue to be used and changed long after its original programmer has finished writing it. Documentation preserves important knowledge about the program so that people do not need to rediscover everything from the source code.
Main Types of Documentation
1. Internal Documentation
Internal documentation appears inside the source program itself. It includes:
- Meaningful variable and function names
- Comments explaining important logic
- Clear indentation and formatting
- Descriptions of functions and assumptions
/* Calculate simple interest */
interest = (principal * rate * time) / 100;2. External Documentation
External documentation is maintained outside the source code. It may include:
- User documentation: instructions explaining how to install, operate, and use the program.
- Technical documentation: information about program design, algorithms, data structures, modules, interfaces, and implementation details.
- Maintenance documentation: information useful for correcting defects and modifying the software later.
Importance of Documentation
- Helps users operate the software correctly.
- Makes program maintenance easier.
- Helps new programmers understand existing software.
- Records design decisions and important assumptions.
- Supports debugging, testing, and future modification.
Common Mistake
Documentation does not mean adding comments to every line of code. Useful documentation explains purpose, assumptions, interfaces, and non-obvious logic. A comment that merely repeats an obvious statement adds little value.
Summary
- Documentation records information needed to understand, use, and maintain software.
- Internal documentation exists inside source code through comments, naming, and clear organization.
- External documentation includes user, technical, and maintenance information.
- Good documentation reduces the effort required to understand or modify a program later.
Test Yourself
- What is program documentation?
- Differentiate between internal and external documentation.
Hints:
- Documentation is written information describing a program's purpose, design, operation, usage, and maintenance.
- Internal documentation is embedded in source code; external documentation is kept separately for users, developers, or maintainers.
Exam Questions
- Differentiate between debugging and testing. (2081)
- Differentiate between source code and object code. (2080)
- Explain structure of a C program with suitable example. (2078)
- Write short notes on: a. History of C (2078)
Whole Chapter Summary
Problem Analysis
Problem analysis determines the exact requirements of a programming problem. It identifies the input, processing, output, and constraints that guide the later solution.
Algorithms and Flowchart
An algorithm expresses a solution as a finite sequence of clear steps. A flowchart represents the same logic graphically using standard symbols and directional arrows.
Coding
Coding converts the designed algorithm into statements of a programming language. The resulting human-readable program is the source code.
Compilation and Execution
C source code passes through preprocessing, compilation, assembly, and linking before becoming an executable program. Object code is machine-level translated code produced before final executable preparation.
History of C
C was developed by Dennis Ritchie at Bell Laboratories in the early 1970s. It developed from earlier work including BCPL and B and became strongly associated with UNIX.
Structure of a C Program
A commonly taught C-program structure contains documentation, link, definition, global declaration, main(), and user-defined function sections. These sections organize the program logically rather than forming a compulsory template for every program.
Debugging
Debugging locates the cause of program defects and corrects them. It commonly involves reproducing a problem, isolating faulty code, making the correction, and retesting.
Testing
Testing compares actual program behavior with expected behavior. Normal, boundary, and invalid inputs are useful for revealing different kinds of defects.
Documentation
Documentation records information needed to understand, operate, and maintain software. It may be internal to source code or maintained externally for users and developers.
Key Formulas and Points Sheet
| Formula / Rule / Sequence | Meaning |
|---|---|
| Input → Processing → Output | Basic model used during problem analysis. |
| Start → Input → Process → Output → Stop | Basic sequence for a simple algorithm or flowchart. |
| Source code → Preprocessing → Compilation → Assembly → Object code → Linking → Executable → Execution | General path from C source code to a running program. |
| Observe → Reproduce → Locate → Diagnose → Correct → Retest | Typical debugging sequence. |
| Expected result ↔ Actual result | Central comparison performed during testing. |
| Normal + Boundary + Invalid | Three useful categories of test data. |
| BCPL → B → C | Simplified historical language-development sequence leading to C. |
Last-Minute Revision Sheet
| Concept | Trigger Phrase | Recall Cue |
|---|---|---|
| Problem Analysis | Understand before solving | Input → Process → Output |
| Algorithm | Written solution steps | Clear + finite + ordered |
| Flowchart | Visual algorithm | Symbols + arrows |
| Coding | Algorithm into language | Logic → source code |
| Source Code | Programmer's version | Human-readable C |
| Object Code | Translated version | Machine-level, may need linking |
| Compiler | Translate source | C → lower-level form |
| Linker | Join program pieces | Objects + libraries → executable |
| Execution | Run the program | Load → perform instructions |
| C History | Ritchie, Bell Labs | BCPL → B → C → UNIX |
| C Structure | Organized program sections | Docs → Link → Define → Global → main() → Functions |
| Debugging | Find cause and fix | Locate → Correct → Retest |
| Testing | Check behavior | Expected vs. actual |
| Test Data | Check different situations | Normal / Boundary / Invalid |
| Documentation | Explain software | Internal + External |
Formatting and coverage follow the supplied unit-note requirements.


