0% found this document useful (0 votes)
39 views2 pages

2 MARKS - Unit I

GE3151-UNIT I_2 Marks

Uploaded by

Muppudathi R
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views2 pages

2 MARKS - Unit I

GE3151-UNIT I_2 Marks

Uploaded by

Muppudathi R
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

GE3151 –PROBLEM SOLVING AND PYTHON PROGRAMMING UNIT -1 (2 MARKS)

1.What is an algorithm?
An algorithm is a finite number of clearly described, unambiguous do able steps that
can be systematically followed to produce a desired result for given input in the given
amount of time. In other word, an algorithm is a step by step procedure to solve a problem
with finite number of steps.

2.What is Pseudo code?


Pseudocode is an informal high-level description of the operating principle of a
computer program or algorithm. Pseudo means false and code refers to instructions
written in programming language.

3. What is Problem Solving?


Problem solving is the systematic approach to define the problem and creating
number of solutions. The problem solving process starts with the problem specifications
and ends with a correct program.

4. Distinguish between algorithm and program.


Algorithm Program
1. Systematic logical approach which is a It is exact code written for problem
well-defined, step-by-step procedure following all the rules of the programming
that allows a computer to solve a language.
problem.
2. An algorithm is a finite number of The program will accept the data to
clearly described, unambiguous do perform computation.
able steps that can be systematically
followed to produce a desired results Program=Algorithm + Data
for given input in the given amount of
time.
5. Define Flow chart.
A graphical representation of an algorithm. Flow charts is a diagram made up
of boxes, diamonds, and other shapes, connected by arrows.

6.Write an algorithm to accept two numbers, compute the sum and print the result.
Step 1: Start
Step 2: Read num1, num2
Step 3: Sum = num1+num2
Step 4: Display sum
Step 5: Stop
7. What are the Guidelines for writing pseudo code?
 Write one statement per line
 Capitalize initial keyword
 Indent to hierarchy
 End multiline structure
 Keep statements language independent.
8.Differentiate between iteration and recursion.

S.No Iteration Recursion


1. Iteration is a process of executing certain Iteration is a process of executing certain
set of instructions repeatedly, without set of instructions repeatedly, by calling
calling the self function. the self function repeatedly.

2. Iterative methods are more efficient Recursive methods are less


because of better execution speed. efficient.
3. It is simple to implement. Recursive methods are complex
to implement.

9.What is Programming language? With example.


Programming Language is a formal language with set of instruction, to the
computer to solve a problem. Java, C, C++, Python, PHP.

10.What are the steps for developing algorithms.


• Problem definition
• Development of a model
• Specification of Algorithm
• Designing an Algorithm
• Checking the correctness of Algorithm
• Analysis of Algorithm
• Implementation of Algorithm
• Program testing
• Documentation Preparation

11.Draw a flow chart to find whether the given year is leap year or not

Start

Read year

If
(year%4==0)

Print ‘Leap year’ Print ‘Not Leap year’

Stop

You might also like