Problem Solving Through C Unit 01 Introduction to Programming Notes Set 01

Download Computer Science Useful Resources

Review targeted academic resources with the Problem Solving Through C Unit 01 Introduction to Programming Notes Set 01. Built according to official standards for the 2026-27 term, these downloadable Computer Science study materials support effective daily practice and deeper conceptual understanding for Programming in C.

Access Study Guides and Summaries

Navigate directly to the advanced Computer Science study materials using the digital viewer below. Each resource pack includes detailed conceptual summaries and solved practice questions, allowing students to instantly reinforce their learning.

This page introduces programming: how a problem is defined and solved with algorithms, pseudocode and flowcharts, and how flowchart symbols are used. It then compares machine, assembly and high-level languages, and follows a C program through compilation, linking, loading, testing, debugging and documentation.

Introduction

Problem definition: A problem definition involves the clear identification of the problem in terms of available input parameters and desired solution.
Approach towards solving the problem: After a problem is identified, the user needs to implement a step-by-step solution in terms of algorithms.
Graphical representation of problem solving sequence: This step involves representing the steps of algorithm pictorially by using a flowchart. Each component of the flowchart presents a definite process to solve the problem.
Converting the sequence in a programming language: Converting the graphical sequence of processes into a language that the user and the computer can understand and use for problem solving is called programming. After the program is compiled the user can obtain the desired solution for the problem by executing the machine language version of the program.

Algorithm

1. A sequential solution of any program that written in human language, called algorithm.
2. Algorithm is first step of the solution process, after the analysis of problem, programmer writes the algorithm of that problem.

Sample Algorithm

Algorithm to reverse the digits of an integer

Input: Number to be reversed N
Output: Reversed number N
Step 1: Input the Number be reversed N.
Step 2: Assign the value of the number N to M; Assign the value L = 0; Store the remainder which obtained by getting the modulus of N and 10 in a variable K.
Step 3: Divide M by 10; Assign L equal to Product of L and 10 and add the sum to K.
Step 4: If M is greater than 0: Yes: Repeat step 3. No: Output The reverse of the number N is L.
Step 5: Stop

1. An algorithm is a step-by-step procedure for solving a stated problem using a reasonable amount of time and storage.
2. Every problem has some input information and some desired results to be obtained.
3. The important aspect is to determine if the information available is really sufficient to solve the problem at hand, and if it is so what are the procedures that should be applied to the given information or data so that the required result can be obtained.
4. The development of a proper procedure to solve the problem is called an algorithm.
5. The operations that can be included in an algorithm are constrained by the possibility of a computer carrying them out.
6. Each operation must be unambiguous about the process to solve the problem.
7. The steps in the process must be effective enough to be theoretically done in a finite amount of time and memory.
8. An algorithm terminates in a reasonably short time.
9. Sample Algorithm:

Go to bus stop.
Catch bus no. M7-B.
Purchase a ticket.
Get down at the market bus stop.

Example of Algorithm

Find out number is odd or even

Step 1: start
Step 2: input number
Step 3: rem=number mod 2
Step 4: if rem=0 then
    print "number even"
else
    print "number odd"
end if
Step 5: stop

What is pseudo code?

1. Pseudocode is a simple way of writing programming code in English.
2. Pseudocode is not an actual programming language.
3. Pseudo code should not include keywords in any specific computer language.
4. It should be written as a list of consecutive phrases.
5. The user should not use flowcharting symbols but he can draw arrows to show looping processes.
6. Indentation can also be used in pseudo code to show the logic.
7. The purpose of using pseudo code is that it is easier for humans to understand than conventional programming language code, and that it is a compact and language independent description of the key principles of an algorithm.
8. Pseudo code is used to quickly draw the outline of a program.
9. It can use any human language.

Example of pseudo code:

Initiate the program
Loop until i = 10
    Write "hello world" to the screen
End exit the loop

1. This is pseudocode.
2. It would not work if you ran it through a c compiler, but it explains the structure of the code and how users are planning to implement it.

if student's grade is greater than or equal to 60
    print "passed"
else
    print "failed"
end if

What is a flowchart?

1. A flowchart is a pictorial representation of the steps that are involved in the procedure.
2. A flowchart also shows the logical sequence in which the steps are to be performed.
3. A flowchart consists of boxes called the symbols and arrows called the flow lines.
4. The box depicts the process and the flow line indicates the next step to be performed.

Elements of a flow chart

Terminal Box

1. This symbol (a rounded box) is used to indicate the beginning or the end of a flowchart.
2. When this symbol is used for START, no flow lines can enter it.
3. Only one flow line can leave this box.
4. When the terminal box is used for STOP, no flow lines can leave this box and any number of flow lines can enter this box.
5. There can be only one START symbol in each flowchart.
6. However there can be more than one STOP symbol in a flowchart.

Process Box

1. The shape of the processing box is a rectangle.
2. This symbol represents one or more instructions that perform a processing function in a program.
3. Examples of processing functions are addition, subtraction, multiplication, division or moving data to storage or assigning a value.

Input/output Box

1. The input/output box is represented by a parallelogram.
2. This symbol indicates any function of an input/output device such as keyboard or printer.
3. An input/output box makes data available for processing or displays the result of processing on the screen.

Decision Box

1. The shape of a decision box is a rhombus.
2. This box is used when two quantities need to be compared.
3. The decision box is also used for a testing condition.
4. Decision box results in two alternative answers to the condition: true or false.
5. The equality, less than, less than or equal to, greater than, greater than or equal to, and not equal to operators can be used in the decision box.

Example of Algorithm and flowchart for same problems

Algorithm for calculate factorial value of a number:

[Algorithm to calculate the factorial of a number]
Step 1. Start
Step 2. Read the number n
Step 3. [Initialize]
    i=1, fact=1
Step 4. Repeat step 4 through 6 while i<=n
Step 5. fact=fact*i
Step 6. i=i+1
Step 7. Print fact
Step 8. Stop
[Process finish of calculate the factorial value of a number]

Flowchart for calculate factorial value of a number

1. START (terminal box).
2. Read n (input/output box).
3. i = 1, fact = 1 (process box).
4. Decision box: is i<=n? If True, go to step 5; if False, go to step 7.
5. fact = fact*i, then i = i+1 (process boxes); the flow line returns to the decision box in step 4.
6. Print fact (input/output box).
7. STOP (terminal box).

Programming language - Introduction

1. A programming language is a set of symbols, grammars and rules with the help of which one is able to translate algorithms to programs that will be executed by the computer.
2. The programmer communicates with a machine using programming languages.
3. There are many different classifications of programming languages and these programming languages differ in their closeness to the machine and in the way they are structured.
4. Most of the programs have a highly structured set of rules.
5. The primary classifications of programming languages are: Machine Languages, Assembly Languages and High-level Languages.

Machine Level Language

1. Machine language is a collection of binary digits or bits that the computer reads and interprets.
2. Machine language is the only language a computer is capable of understanding.
3. Machine level language is a language that supports the machine side of the programming or does not provide human side of the programming.
4. It consists of (binary) zeros and ones.
5. A machine-level language is the lowest form of computer language.
6. Each instruction in a program is represented by a numeric code, and numerical addresses are used throughout the program to refer to memory locations in the computer’s memory.
7. All book keeping aspects of the program are the sole responsibility of the machine-language programmer.
8. Finally, all diagnostics and programming aids must be supplied by the programmer.
9. Also included as machine-level programs are programs written in microcode (i.e., micro programs).
10. Microcode allows for the expression of some of the more powerful machine-level instructions in terms of a set of basic machine instructions.
11. Each computer has only one programming language which does not need a translating program – the machine language.
12. Machine language programs, the first generation programs, are written at the most basic level of computer operation.
13. Because their instruction are directed at this basic level of operation, machine language and assembler language are collectively called low-level language.
14. In machine language, instruction are coded as a series of ones and zeroes.
15. The machine language programs are cumbersome and difficult to write.
16. The machine language is native to that machine and understood directly by the machine.
17. The machine language generally has two parts: Opcode and Operand.
18. The opcode of machine language tells what function to perform to the computer.
19. The operand gives the data on which the operation has to be performed or the location where the data can be found.

Advantages

1. Machine-level instructions are directly executable.
2. Machine-level language makes most efficient use of computer system resources like storage and register.
3. Machine language instruction can be used to manipulate individual bits.
4. As the machine inherently understands machine instruction, machine languages are very fast.

Disadvantages

1. Difficult to program: Programming in machine language is the most difficult kind of programming. Instruction should be encoded as a sequence of incomprehensible 0’s and 1’s which is very difficult.
2. Error-prone: In machine language, the programmer has to look into all the activities like memory management, instruction cycle, etc., which diverts his attention from the actual logic of the program. This frequently leads to error.
3. Machine dependent: Every computer is different from one another in its architecture. Hence, instructions of one machine will be different from the other.
4. As machine-level language are device dependent, the programs are not portable from one computer to another.
5. Programming in machine language usually results in poor programmer productivity.
6. Programs in machine language are more error prone and difficult to debug.
7. Computer storage location must be address directly, not symbolically.
8. Machine language requires a high level of programming skill, which increases programmer training costs.

Assembly Level Language

1. A set of instructions for an assembly language is essentially one-to-one with those of machine language.
2. Like machine language, assembly language are unique to a computer.
3. The big difference is that instead of a cumbersome series of ones and zeroes, assembly languages use easily recognizable symbols called mnemonics, to represent instructions.
4. As said before, machine language and assembly language are low-level languages and are dependent on particular machine architecture.
5. They are more close to the machine rather than the programmer.
6. The only difference between assembly language and machine language is that assembly language is relatively easier to use than machine language.
7. In a pure assembly language, each statement produces exactly one machine instruction (one-to-one correspondence between machine instructions and statements in assembly language).
8. So an n-line assembly language program will produce an n-word machine language program.
9. Assembly language which uses mnemonic codes is easier than machine language using binary or hexadecimal codes.
10. It is easier to remember ADD, SUB, MUL, or DIV, than their corresponding numerical values in machine language.
11. Assembly language uses symbolic names for memory locations while machine language needs numerical values.
12. The assembly language can directly test if there is an overflow bit while a higher level language cannot.
13. An assembly language can only run on one family of machines (each machine has its own assembly language) while a higher level language can run on many machines.

Advantages

1. Assembly language is easier to use than machine language.
2. An assembler is useful for detecting programming errors.
3. Programmers do not have the absolute address of data items.
4. Assembly language encourage modular programming.

Disadvantages

1. Assembly language programs are not directly executable.
2. Assembly language are machine dependent and, therefore, not portable from one machine to another.
3. Programming in assembly language requires a higher level of programming skill.

High Level Language

1. High level language is a language that supports the human and the application sides of the programming (typical features: ability to logic structuring of the algorithm, cross-platform independence).
2. A language is a machine-independent way to specify the sequence of operations necessary to accomplish a task.
3. A language can be designed to be express in a concise way, a common sequence of operations.
4. A line in a high level language can execute powerful operations, and correspond to tens, or hundreds, of instructions at the machine level.
5. Although many programmers prefer assembly language, because it works more efficiently, the power and flexibility of new generation languages have put them beyond low-level languages in terms of both human and computer efficiency.
6. Consequently more programming is now done in high-level languages.
7. Examples of high-level languages are BASIC, FORTRAN etc.,
8. High-level languages are more, like English statements, which are easy to understand and to use.
9. High-level languages are more close to the programmer and ease the task of programming.
10. Higher-level languages provide a richer set of instructions and support, making the programmer’s life even easier.
11. Yet before a high-level program can be executed on a given CPU, it must be translated back to machine code.
12. A programming language such as C, FORTRAN, or Pascal that enables a programmer to write programs that is more or less independent of a particular type of computer.
13. Such languages are considered high-level because they are closer to human languages and further from machine languages.
14. In contrast, assembly languages are considered low-level because they are very close to machine languages.

Features of high level languages

1. High level languages are easily understandable.
2. The programs that are developed in high level language are portable.
3. In case of high level languages debugging of the code is easy and the program written is not machine dependent.

Advantages of high-level languages include

1. Easier to program. The programmer can concentrate on the logic of the program rather than on the register, ports and memory storage.
2. Machine-independent. Provided some other machine has the same compiler and libraries, the program can be ported across various platforms.
3. Easy maintenance. A program in a high-level language is easier to maintain than assembly language, because it is easier to code and locate bugs in high-level languages.
4. Easy to learn. The learning curve for high-level languages is relatively smooth than low-level languages.
5. Other than this, high-level languages are more flexible and can be easily documented.

Compilation

1. The compiler program translates the instructions of a high-level language to a machine level language.
2. A separate compiler is required for every high-level language.
3. High level language is simply a programmer’s convenience and cannot be executed in their source.
4. The actual high-level program is called a source program.
5. It is compiled (translated) to machine level language program called object program for that machine by the compiler.
6. Such compilers are called self-resident compilers.
7. Compiler compiles the full program and reports the errors at the end.

What is "compilation"?

1. The compiler is the tool to convert a program written in a high level language into the sequence of machine instructions required by a specific computer to accomplish the task.
2. Users typically control details of the operation of compilers by means of options supplied on the command line, or directives embedded in the program source, but they seldom need to examine the resulting machine language code.
3. This process of converting high level language to machine level is called compilation.
4. The translation of source code into object code by a compiler.

Compilation Process

The compilation and execution process of C can be divided in to multiple steps:

1. Preprocessing - Using a Preprocessor program to convert C source code in expanded source code. "#include" and "#define" statements will be processed and replaced actually source codes in this step.
2. Compilation - Using a Compiler program to convert C expanded source to assembly source code.
3. Assembly - Using a Assembler program to convert assembly source code to object code.
4. Linking - Using a Linker program to convert object code to executable code. Multiple units of object codes are linked to together in this step.
5. Loading - Using a Loader program to load the executable code into CPU for execution.

In the process diagram, the source code passes through the Preprocessor and the Compiler to give assembly code, the Assembler turns it into object code, and the Link Editor combines the object code with the libraries to give the executable code.

Linking and Loading

What is "linking"?

1. After all of the files are compiled, they must be "merged together" to produce a single executable file that the user use to run the program.
2. In C, most compiled programs produce results only with the help of some standard programs, known as library files that reside in the computer.
3. This process is called linking.
4. The result obtained after linking is called the executable file.
5. To build an executable file, the linker collects the object files and libraries.
6. The linker’s primary function is to bind symbolic names to memory addresses.
7. To do this, it first scans the files and concatenates the related file sections to form one large file.
8. Then, it makes a second pass on the resulting file to bind symbol names to real memory addresses.
9. Linking is the process of taking some smaller executable and joining them together as a single larger executable.
10. Loading is loading the executable into memory prior to execution.
11. There are two types of linking: Static linking and Dynamic linking.
12. Static linking occurs at compilation time; hence it occurs prior to loading a program.
13. With static linking the external symbols that are used by the program (e.g. function names) are resolved at compile time.
14. Dynamic linking occurs at run time, so it occurs after or at the time of the loading of a program.
15. With dynamic linking the symbols are resolved either at loading time, or at run time when the symbol is accessed (lazy binding).

What is "loading"?

1. After the files are compiled and linked the executable file is loaded in the computer’s memory for executing by the loader.
2. This process is called Loading.
3. Program loading is basically copying a program from secondary storage into main memory so it’s ready to run.
4. In some cases, loading is not just copying the data from disk to memory, but also setting protection bits, or arranging for virtual memory map virtual addresses to disk pages.

Testing and Debugging

Testing involves finding problems in the code. What does one Test for?

1. Compilation Errors.
2. Syntax errors: The compiler cannot understand user’s program because it does not follow the syntax. Common syntax errors are: (a) Missing or misplaced ; or }, (b) Missing return type for a procedure, (c) Missing or duplicate variable declarations.
3. Type errors: These errors include type mismatch when the user assign a value to a variable and type mismatch between actual and formal parameters.
4. Runtime Errors: Output errors: These errors result when the program runs but produces an incorrect result. An output error indicates an error in the meaning or logic of the program. Exceptions: These errors occur when the program terminates abnormally. Examples include division by zero and out of memory. Exceptions indicate an error in the semantics or the logic of a program.
5. Non-termination errors: These errors occur when the program does not terminate as expected, but continues running endlessly.

1. Debugging consists of isolating and fixing the problems.
2. Testing and debugging are necessary stages in the development cycle, and they are best incorporated early in the cycle.
3. Thoroughly testing and debugging individual components makes testing and debugging integrated applications much easier.

What is Documentation?

1. Documentation of a program consists of written description of program’s specification, its design, coding, operating procedures etc.
2. Documentation is either incomplete or inaccurate, making the users and maintenance programmers irritated and annoyed over it.
3. Documentation can be broadly classified into two types: Documentation for users and Documentation for maintenance programmers.
4. The written text and comments that make a program easier for others to understand use and modify.
5. The compiler in the compilation process ignores comments.
6. It provides information about the steps and procedures.

CBSE Computer Science Study Material: Programming in C

Quick Revision Material for Programming in C

Review targeted study resources for Programming in C tailored for learners. Utilizing these structured notes and quick-revision tools ensures complete alignment with current CBSE evaluation standards.

Expert Notes and Solved Exam Questions

Designed around the official curriculum, these study guides guarantee standard compliance. Reviewing step-by-step solutions clarifies complex sub-topics within Programming in C and demystifies standard marking schemes for Computer Science evaluations.

Additional Study Resources for

For peak performance in upcoming evaluations, integrate official Computer Science sample papers directly into your study schedule. Follow up your revision by attempting online MCQ tests for Programming in C to refine calculation speed and precision.

FAQs

Where can I find the most advanced study material for [current-page:node:field_board] [current-page:node:field_class] Computer Science for 2026-27?

The latest 2026-27 advanced study resources for Computer Science are available for free on StudiesToday.com which includes NCERT Exemplars, high-order thinking skills (HOTS) questions, and deep-dive concept summaries.

What does the 2026-27 Computer Science study package for [current-page:node:field_class] include?

Our exhaustive Computer Science package includes chapter wise revision notes, solved practice sheets, important formulas and Concept Maps to help in better understanding of all topics.

Is this study material enough for both [current-page:node:field_board] exams and competitive tests?

Yes. For , our resources have been developed to help you get better marks in school exams and also build fundamental strength needed for entrance tests including Competency Based learning.

How should [current-page:node:field_class] students use this Computer Science material for maximum marks?

in , students should use Active Recall method, read the concept summary, then solve the Important Questions section without looking at the answers and then check your answers.

Can I download [current-page:node:field_class] Computer Science study notes in PDF for offline use?

All Computer Science study materials are provided in mobile-friendly PDF. You can download and save them on your device.

Are the [current-page:node:field_class] Computer Science resources updated for the latest NEP guidelines?

Yes, our team has ensured that all Computer Science materials for are strictly aligned with the National Education Policy (NEP) 2020 and the latest 2026-27 syllabus.