TUpapers logo TUpapers.com

Explore TUpapers

Study materials and tools in one place.

  • Dashboard
  • Blog
  • Search
  • About

Follow us

TUpapers on Facebook
TUpapers on Instagram
Contact TUpapers on WhatsApp
TUpapers subreddit on Reddit
Student Dashboard Student Dashboard
TUpapers logo TUpapers.com
  • Blog
  • About

Support Us

Your support helps us for further development and maintenance of site and resources!

Bank QR code for payment
eSewa QR code for payment
Khalti QR code for payment

The best way to support TUpapers is by purchasing a Premium Suscription or Notes Every purchase directly funds new features, better study resources, and platform maintenance.

On this chapter

Problem Solving with Computer

All Chapters

Dashboard

Select a chapter to start reading

C Programming Notes | CSIT First Semester | TU Papers

1 Chapter 1 Preview

No preview available.

Notes for this subject are coming soon — check back later.

Student Dashboard

Continue Reading

Get full notes inside the dashboard, along with other study tools.

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

  1. Compilation process: source code vs object code — 1x (2080)
  2. Debugging & testing — 1x (2081)
  3. History of C — 1x (2078)
  4. 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

  1. Identify the problem: understand the task that has to be solved.
  2. Identify the input: determine the data that must be supplied to the program.
  3. Identify the required output: determine what result the program must produce.
  4. Determine the processing: find the calculations, decisions, or operations needed to transform the input into the required output.
  5. 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.

PartAnalysis
InputMarks of three subjects: m1, m2, and m3
Processingtotal = m1 + m2 + m3; average = total / 3
OutputAverage 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

  1. What is problem analysis in computer programming?
  2. Analyze a problem that calculates the area of a rectangle in terms of input, processing, and output.

Hints:

  1. It is the process of identifying the problem, required inputs, processing steps, outputs, and constraints before programming.
  2. 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: Stop

The sequence is:

Start → Read values → Add values → Display result → Stop

Common Flowchart Symbols

SymbolNamePurpose
OvalTerminalRepresents Start or Stop.
RectangleProcessRepresents calculation or processing.
ParallelogramInput/OutputRepresents reading input or displaying output.
DiamondDecisionRepresents a condition with alternative paths such as Yes/No.
ArrowFlow lineShows the direction in which control moves.
CircleConnectorConnects separated parts of a flowchart.

Flowchart for Adding Two Numbers

     ┌─────────┐
     │  Start  │
     └────┬────┘
          │
          ▼
   ┌─────────────┐
   │ Input A, B  │
   └──────┬──────┘
          │
          ▼
   ┌─────────────┐
   │ Sum = A + B │
   └──────┬──────┘
          │
          ▼
   ┌─────────────┐
   │ Display Sum │
   └──────┬──────┘
          │
          ▼
     ┌─────────┐
     │  Stop   │
     └─────────┘

Algorithm vs. Flowchart

BasisAlgorithmFlowchart
FormWritten sequence of stepsGraphical representation of steps
RepresentationUses statements or pseudocodeUses standard symbols and arrows
PreparationUsually quicker to writeRequires drawing symbols and connections
ModificationSteps can usually be changed easilyChanges may require redrawing part of the chart
VisualizationLogic is described textuallyProgram 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

  1. Define an algorithm and list its major characteristics.
  2. What is a flowchart? Explain the common symbols used in a flowchart.
  3. Write an algorithm to find the greater of two numbers.

Hints:

  1. An algorithm is a finite sequence of clear steps. Key characteristics include input, output, definiteness, finiteness, and effectiveness.
  2. A flowchart visually represents an algorithm. Include terminal, process, input/output, decision, flow line, and connector symbols.
  3. 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

  1. What is coding?
  2. How is coding related to an algorithm?

Hints:

  1. Coding is the conversion of program logic into statements written in a programming language.
  2. 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

BasisSource CodeObject Code
MeaningProgram written by the programmerMachine-level code produced after translation
ReadabilityHuman-readableNot conveniently readable by humans
CreationCreated using a text editor or development environmentGenerated by translation tools
Language formUses statements and syntax of CUses machine-level binary representation
PurposeUsed for writing and maintaining the programUsed as an intermediate machine-level form before or during linking
Typical fileCommonly stored in a .c fileCommonly 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

  1. Explain the main stages from C source code to program execution.
  2. What is the role of a linker?
  3. Differentiate between source code and object code. (2080)

Hints:

  1. Source code → preprocessing → compilation → assembly → object code → linking → executable → loading and execution.
  2. The linker combines object modules with required library code and resolves external references to create an executable.
  3. 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

  1. State who developed C, where it was developed, and which earlier languages influenced it.
  2. Write short notes on: a. History of C (2078)

Hints:

  1. Dennis Ritchie developed C at Bell Laboratories in the early 1970s. BCPL and B were important predecessors.
  2. 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:

  1. Documentation section
  2. Link section
  3. Definition section
  4. Global declaration section
  5. main() function section
  6. 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.14159

The 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

  1. Name and explain the commonly taught sections of a C program.
  2. Why are user-defined functions used in a C program?
  3. Explain structure of a C program with suitable example. (2078)

Hints:

  1. Documentation, link, definition, global declaration, main() function, and user-defined function sections.
  2. They divide a program into manageable tasks, support reuse, and improve organization.
  3. 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

  1. Observe the failure: identify the incorrect behavior or error message.
  2. Reproduce the problem: determine the conditions under which the error occurs.
  3. Locate the faulty area: narrow the problem to a statement, function, or section of code.
  4. Determine the cause: understand why the code behaves incorrectly.
  5. Correct the defect: modify the code.
  6. Retest: run relevant tests again to confirm the correction works and has not introduced another defect.

Debugging vs. Testing

BasisDebuggingTesting
MeaningFinding the cause of a defect and correcting itExecuting or evaluating software to detect defects and verify expected behavior
Main purposeRemove a known problemDiscover problems and determine whether requirements are satisfied
When performedUsually after a failure or defect has been identifiedPerformed systematically throughout development and after changes
ActivityTrace, inspect, isolate, and modify codeProvide test cases, compare expected and actual results
ResultCorrected program codeEvidence 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

  1. What is debugging? Describe its basic steps.
  2. Give one example each of a syntax error and a logical error.
  3. Differentiate between debugging and testing. (2081)

Hints:

  1. Debugging means locating, understanding, correcting, and retesting program defects.
  2. Syntax: missing semicolon. Logical: incorrect formula such as a + b / 2 instead of (a + b) / 2.
  3. 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

  1. Define the expected result: determine what correct behavior should look like.
  2. Select test data: choose input values and operating conditions.
  3. Execute the program: run it using the selected data.
  4. Observe the actual result: record what the program produces.
  5. Compare expected and actual results: determine whether the test passes or fails.
  6. Report defects: document unexpected behavior for debugging and correction.
  7. Retest after correction: confirm that the modified program now behaves correctly.

Types of Test Data

Test DataMeaningExample
Normal dataOrdinary valid input within the expected rangeAge = 20 when valid ages are 1 to 120
Boundary dataInput at or very close to the allowed limitsAge = 1 or Age = 120
Invalid dataInput outside the permitted rules or rangeAge = -5

Example

Suppose a program accepts marks from 0 to 100.

InputCategoryExpected Behavior
65NormalAccept the value
0BoundaryAccept the value
100BoundaryAccept the value
-1InvalidReject the value
101InvalidReject 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

  1. What is software testing?
  2. Explain normal, boundary, and invalid test data with examples.
  3. Why should a program be tested even after it compiles successfully?

Hints:

  1. Testing checks program behavior using selected inputs and compares actual results with expected results.
  2. Normal = ordinary valid input; boundary = input at the permitted limits; invalid = input outside permitted rules.
  3. 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

  1. What is program documentation?
  2. Differentiate between internal and external documentation.

Hints:

  1. Documentation is written information describing a program's purpose, design, operation, usage, and maintenance.
  2. Internal documentation is embedded in source code; external documentation is kept separately for users, developers, or maintainers.

Exam Questions

  1. Differentiate between debugging and testing. (2081)
  2. Differentiate between source code and object code. (2080)
  3. Explain structure of a C program with suitable example. (2078)
  4. 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 / SequenceMeaning
Input → Processing → OutputBasic model used during problem analysis.
Start → Input → Process → Output → StopBasic sequence for a simple algorithm or flowchart.
Source code → Preprocessing → Compilation → Assembly → Object code → Linking → Executable → ExecutionGeneral path from C source code to a running program.
Observe → Reproduce → Locate → Diagnose → Correct → RetestTypical debugging sequence.
Expected result ↔ Actual resultCentral comparison performed during testing.
Normal + Boundary + InvalidThree useful categories of test data.
BCPL → B → CSimplified historical language-development sequence leading to C.

Last-Minute Revision Sheet

ConceptTrigger PhraseRecall Cue
Problem AnalysisUnderstand before solvingInput → Process → Output
AlgorithmWritten solution stepsClear + finite + ordered
FlowchartVisual algorithmSymbols + arrows
CodingAlgorithm into languageLogic → source code
Source CodeProgrammer's versionHuman-readable C
Object CodeTranslated versionMachine-level, may need linking
CompilerTranslate sourceC → lower-level form
LinkerJoin program piecesObjects + libraries → executable
ExecutionRun the programLoad → perform instructions
C HistoryRitchie, Bell LabsBCPL → B → C → UNIX
C StructureOrganized program sectionsDocs → Link → Define → Global → main() → Functions
DebuggingFind cause and fixLocate → Correct → Retest
TestingCheck behaviorExpected vs. actual
Test DataCheck different situationsNormal / Boundary / Invalid
DocumentationExplain softwareInternal + External

Formatting and coverage follow the supplied unit-note requirements.

Views: …
TUpapers.com logo tupapers.com
  • Privacy Policy

  • Contact Us

  • Terms

  • Pricing

  • SEEpapers.com

TUpapers on Facebook
TUpapers on Instagram
Contact TUpapers on WhatsApp Contact TUpapers on WhatsApp
TUpapers subreddit on Reddit

Courses

  • BBA

  • BCA

  • BIT

  • CSIT

  • BBS

  • BHM

  • BBM

  • BITM

  • BTTM

  • BA

  • BE

  • BSW

© 2026 tupapers.com. All rights reserved.