Uploaded by sanjeewa mayadunne

Programming

advertisement
Programming
Example 1
Programming
Programming
Programming
Algorithm
 Algorithm is method which incudes all the
steps of solving a problem.
Flow Chart
 Flow charts is a graphical representation of
Algorithmic steps.
Programming
Format of Algorithm
Step 1.Start
Step 2.Sequeance
Step 3.Selection
Control Structures
Step 4.Repetition
Step 5.End
Programming
Programming
 What is variable
Variable is used to store value in memory
temporarily
Example
A
B
C
Programming
 A glass is filled with Fanta
 C glass is filled with Potalo
 Task=Change C to A and A to C
1
2
A
B
C
Programming
 Put A into B
A
B
Programming
 Put C to A
A
C
A
C
Programming
 Put B to C
B
C
B
C
Programming
 Assign Values to Variables
Rule
Variable is written left to the equal sign and
Value is written right to the equal sign
Example
A=10
Variable
Value
Programming
 Assign 10 to A
L
 Assign value Right to Left
R
A=10
0
0
10
A
A
Just created
After Assign Value
Programming
0
B
0
C
Programming
B=10
10
C=A + B
10
A
+
10
20
B
C
Download