Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
12Activity
0 of .
Results for:
No results containing your search query
P. 1
Ccp Lab Manual2010

Ccp Lab Manual2010

Ratings:

5.0

(2)
|Views: 3,229|Likes:
Published by Manjunath Yadav

More info:

Published by: Manjunath Yadav on Jun 19, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/04/2013

pdf

text

original

 
CCP Lab Manual, 10CPL16/26
Dept of CSE, CMRIT, B’
lore
37 Page 1
The Meaning of an Algorithm
 
:
 
An algorithm is a basic tool which is used to express the solution for a given problemsystematically in the form of instructions. This solution is called logic. It takes a set of inputvalues and produces the desired output.
 
An algorithm is defined as unambiguous, step by step procedure (instructions) to solve agiven problem in finite number of steps by accepting a set of inputs and producing the desiredoutput. After producing the result, the algorithm should terminate. Usually, Algorithm arewritten in simple English like statements along with simple mathematical expressions.
Characteristics of an Algorithm:
 
Input:
It may accept a zero or more inputs.
 
Output:
It should produce at least one output(result).
 
Definiteness:
Each instruction must be clear , well-defined and precise. There should not beany ambiguity.
 
Finiteness:
It shoild be a sequence of finite instructions. That is, it should end after a fixedtime. It should not enter into an infinite loop.
 
 
Effectiveness:
This means that operations must be simple and are carried out in a finite timeat one or more levels of complexity. It should be effective whenever traced manually for theresults.
 
Algorithmic Notations:
 
Name of the Algorithm
 
Step number
 
Explanatory Comment
 
Termination
Algorithm to find Area of Rectangle:
Step 1: [Read the values of length and breadth]Read length, breadth.Step 2: [Find the area of rectangle]Area=length*breadth.Step 3: [Output the result]Print area.Step 4: [End of Algorithm]Stop
 
CCP Lab Manual, 10CPL16/26
Dept of CSE, CMRIT, B’
lore
37 Page 2
The Meaning of Flowchart :
 
A flowchart is a pictorial representation of an algorithm. That is flowchart consists of sequence of instructions that are carried out in an algorithm. All the steps are drawn form of different shapes of boxes, circle and connecting arrows. Flowcharts are mainly used to helpprogrammer to understand the logic of the program.
 
The various types of geometric shapes, arrows and symbols used while drawing the flowchartare called flowchart symbols. The symbols used and the meaning associated with eachsymbol are shown below.
Symbols used Meaning associated with symbolsStart or end of the flow chart(program)Computational steps (used while assigning andcalculating Some results )Input or output operationDecision making and branchingConnectorPredefined computation or process (used with functionsare used)Repetition or a loop which is normally used to execute agroup of instructions for a specifies number of timesFlow of controlEntry to execute statements parallelyStop to execute statements parallely
 
CCP Lab Manual, 10CPL16/26
Dept of CSE, CMRIT, B’
lore
37 Page 3
Flow chart to find the area of rectangleInstall Turbo C on your machine and follow the steps given below in order to type andrun the program given above:
 
Go to the directory where you have installed Turbo C.
 
Type TC at the DOS command prompt.
 
In the edit window that opens, type the mentioned program above.
 
Save the program as hello.c by pressing F2 or Alt + „S‟.
 
Press Alt +
„C‟ or Alt + F9 to compile the program.
 
Press Alt + „R‟ or Ctrl + F9 to execute the program.
 
Press Alt + F5 to see the output.
ORInstructions to use Turbo C
On Windows/DOS (Disk Operating System) platform you will be
 
using Turbo C++ editor,the following steps help you in entering and compiling your C program.
 
At the DOS prompt type cd tc and press the ENTER key.
 
Then type cd bin
 
Next type tc to load and execute the TC editor.
 
Press F3 key and type the file name in the small window and press the ENTER key. (Eg.Hello. c)
 
START
Read length and breadthArea=lengrth*breadthPrint area
STOP

Activity (12)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
EKTHATIGER633590 liked this
Rony Joseph liked this
Rony Joseph liked this
Rony Joseph liked this
Rony Joseph liked this
Rony Joseph liked this
Rony Joseph liked this
Rony Joseph liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->