written 5.7 years ago by | • modified 5.7 years ago |
Subject : Structured Programming Approach
Title : Introduction to Computer, Algorithm and Flowchart
Marks : 10M
written 5.7 years ago by | • modified 5.7 years ago |
Subject : Structured Programming Approach
Title : Introduction to Computer, Algorithm and Flowchart
Marks : 10M
written 5.7 years ago by | • modified 5.7 years ago |
Programming is to give the machine a list of steps to perform a particular task.
If the system to which programming is done is a computer than it is called as Computer programming.
A programming of any system has to be done in the language understood by that system.
Programming languages are an interface between humans and computer, they allow us to communicate with computers in order to do awesome things.
Structured programming (SP) is a technique devised to improve the reliability and clarity of programs
In SP, control of program flow is restricted to three structures, sequence, IF THEN ELSE, and DO WHILE, or to a structure derivable from a combination of the basic three. Thus, a structured program does not need to use GO TOs or branches (unless it is written in a language that does not have statement forms corresponding to the SP structures, in which case, GO TOs may be used to simulate the structures).
The result is a program built of modules that are highly independent of each other.
In turn, this allows a programmer to be more confident that the code contains fewer logic errors and will be easier to debug and change in the future.
However, SP may be less efficient than an unstructured counterpart.
Algorithm:
START
PRINT “Enter a number”
INPUT n.
d1 = n mod 10
d2 = n/10
PRINT d1, d2.
STOP.
Flowchart: