0% found this document useful (0 votes)
16 views

Programming Process

Uploaded by

meenakshi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Programming Process

Uploaded by

meenakshi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

(Syllabus:Programming Process: Problem definition, Algorithm development, Flowchart,

Coding, Compilation and debugging)

Previous year question:

Program:
Program is the set of instructions which is run by the computer to perform specific task.
The task of developing program is called programming.

what is problem definition


in c language ?
In C language, a problem
definition refers to a clear
statement that describes
the objective of a
program or application. It
outlines the problem to be
solved and the
requirements of the
solution.
A problem definition in C
language should include
the following:
Problem statement: A
concise description of the
problem to be solved. This
should be specific,
measurable, and clear.
Inputs and outputs: The
inputs that the program will
take and the outputs it will
produce.
Constraints: Any limitations
or restrictions on the
problem, such as time or
memory constraints.
Assumptions: Any
assumptions made about
the input or output data, or
the problem itself.
Expected behaviour: A
description of what the
program should do when it
is executed.
Examples: Examples of
input/output data to help
clarify the problem.
A clear problem definition is
essential to writing an
effective program or
application, as it helps the
developer understand the
requirements and
constraints of the problem
and develop an appropriate
solution.
what is problem definition
in c language ?
In C language, a problem
definition refers to a clear
statement that describes
the objective of a
program or application. It
outlines the problem to be
solved and the
requirements of the
solution.
A problem definition in C
language should include
the following:
Problem statement: A
concise description of the
problem to be solved. This
should be specific,
measurable, and clear.
Inputs and outputs: The
inputs that the program will
take and the outputs it will
produce.
Constraints: Any limitations
or restrictions on the
problem, such as time or
memory constraints.
Assumptions: Any
assumptions made about
the input or output data, or
the problem itself.
Expected behaviour: A
description of what the
program should do when it
is executed.
Examples: Examples of
input/output data to help
clarify the problem.
A clear problem definition is
essential to writing an
effective program or
application, as it helps the
developer understand the
requirements and
constraints of the problem
and develop an appropriate
solution.
https://www.studocu.com/in/document/shri-vaishnav-vidyapeeth-vishwavidyalaya/computer-
system-organization/problem-defination-notes-of-c-language/47966718

Problem definition:
“It is an action to identify the problem, to understand the problem, and to
understand any Constraints that may be the limits of the solution.”

This is the first step to develop the program.

In this we understand the problem for which the program has to be developed.
That is, the problem is identified and understood in this.

In this step, the problem is formally defined.

In this all the factors like – input/output, memory requirement, processing


requirement, error handling etc. are discussed.

Processes (problem solving steps):


 A computer cannot solve a problem by itself. The computer has to provide
a step-by-step solution to the problem. In fact, it is not the job of the
computer to solve the problem.
 It is the programmer who has to write the solution to the problem in terms
of simple operations that the computer can understand and operate.

Problem Solving Steps:-

To solve a problem through computer one has to go through certain steps. Such
as follows,

1. Understanding the Problem:


Here we try to understand to solve the problem completely. Before taking
the next step, you must be absolutely sure of the motives of a problem.
2. Problem Analysis:
Once we fully understand how to solve the problem, we look for different
ways to solve the problem and evaluate each of these methods. The idea
here is to find the right solution to the problem in question.

The end result of this step is a detailed review of the sequence of actions taken
to solve a problem.

3. Developing Solutions:
Here an overview of the sequence of operations resulting from the analysis
phase is extended to a step-by-step solution to the problem in question.
4. Coding and Implementation:
The final step in problem solving is to translate the detailed sequence of
operations into a language that the computer can understand. Here each
step is converted into its equivalent instruction or instruction in the
computer language which has been selected for implantation.

What is an algorithm in C?
An algorithm in C is a step-by-step procedure to solve a specific problem or perform a
task, implemented using the C programming language. It's a set of instructions that
takes some input, processes it, and produces an output. In C, algorithms are typically
implemented as functions or a series of functions that work together to achieve a goal.

Uses of Algorithm
Algorithms are essential in both programming and various other fields. Here are some
key uses:
1. Sorting and Searching Data: Algorithms like Quick Sort or Binary Search are used to
organize data and find specific items efficiently.
2. Performing Mathematical Calculations: Algorithms such as those for computing
factorials, prime numbers, or solving equations are fundamental in both simple and
complex mathematical tasks.
3. Processing and Analyzing Large Datasets: Data processing algorithms, including those
for data mining and statistical analysis, help in extracting valuable insights from large
amounts of data.
4. Optimizing Resource Allocation: Algorithms in operations research help in optimizing
resources like scheduling, inventory management, and network design.
5. Solving Complex Problems: In fields like artificial intelligence and machine learning,
algorithms are used to train models, make predictions, and automate decision-making.
6. Automating Decision-Making Processes: Decision-making algorithms are used in
applications such as recommendation systems, financial trading, and automated customer
support.
7. Improving Efficiency in Various Industries: Algorithms enhance efficiency in logistics
(routing and scheduling), finance (portfolio management), and other sectors by optimizing
processes and reducing costs.
Need for Algorithms
Algorithms are essential in programming for several reasons:
1. Efficiency: They help create faster, more optimized code
2. Scalability: Well-designed algorithms can handle increasing amounts of data
3. Problem-solving: They provide structured approaches to tackle complex issues
4. Consistency: Algorithms ensure reliable and repeatable results
5. Abstraction: They allow programmers to focus on high-level problem-solving rather than
low-level details
6. Reusability: Once developed, algorithms can be applied to similar problems across
different domains
7. Performance analysis: Algorithms provide a basis for comparing different solutions to the
same problem
Features of the Algorithm
Algorithms in C programming are distinguished by several key features that make them
fundamental to creating effective & efficient software. Here’s a detailed look at these
features:
 Definiteness: Each step of an algorithm is clear & unambiguous. In C programming, this
means that every operation, from variable declaration to loops and conditionals, must be
precisely defined to avoid errors during execution.

 Finiteness: Algorithms must have a finite number of steps. This ensures that they
eventually terminate & produce a result after executing their defined steps a certain
number of times.

 Input: Algorithms take zero or more inputs. In the context of C programming, these inputs
could be data like numbers, array elements, or any valid data type, provided to the
algorithm to process a specific task.

 Output: For every input, an algorithm should produce at least one output. This output is
the result of processing the given inputs through the set of well-defined instructions.

 Effectiveness: Each step of an algorithm must be basic enough to be carried out, in


principle, by a person using only pencil & paper. While computers process these steps
much faster, the concept emphasizes that steps should be simple & executable.

 Generality: The algorithm should be applicable to a set of problems rather than a single
problem. This means the algorithm can solve general cases and isn't tailored to specific
inputs.

Algorithm:
Algorithm is the set of rules that define how particular problem can be solved in finite
number of steps. Any good algorithm must have following characteristics

1. Input: Specify and require input


2. Output: Solution of any problem
3. Definite: Solution must be clearly defined
4. Effective
5. Finite: Steps must be finite
6. Correct: Correct output must be generated

Advantages of Algorithms:

1. It is the way to sole a problem step-wise so it is easy to understand.


2. It uses definite procedure.
3. It is not dependent with any programming language.
4. Each step has it own meaning so it is easy to debug

Disadvantage of Algorithms:

1. It is time consuming
2. Difficult to show branching and looping statement
3. Large problems are difficult to implement

Flowchart:
The solution of any problem in picture form is called flowchart. It is the one of the most
important technique to depict an algorithm.

Advantage of Flowchart:

1. Easier to understand
2. Helps to understand logic of problem
3. Easy to draw flowchart in any software like MS-Word
4. Complex problem can be represent using less symbols
5. It is the way to documenting any problem
6. Helps in debugging process

Disadvantage of Flowchart:

1. For any change, Flowchart have to redrawn


2. Showing many looping and branching become complex
3. Modification of flowchart is time consuming

Symbol Used in Flowchart:

Symbol Name

Terminal

Use
Input / Output

Processing Used

Arrow

Connector

Decision

Example: Algorithm and Flowchart to check odd or even

Solution:

Algorithm:
Step 1: Start

Step 2: Declare a variable x

Step 3: Take a input from user and store in x

Step 4: IF x % 2 == 0 THEN

PRINT Even

ELSE

PRINT Odd

Step 5: End

Flowchart:
Coding, Compiling and Execution

You might also like