Advertisement
Advertisement
Advertisement
Answer in Brief
What is the need of computer programming. What do you mean by structured programming? Develop an ALGORITHM and FLOWCHART to find reverse of a number.
Advertisement
Solution
- 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:
1. START
2. PRINT “Enter a number”
3. INPUT n.
4. d1 = n mod 10
5. d2 = n/10
6. PRINT d1, d2. 7. STOP.
Flowchart:
Concept: Three Construct of Algorithm and Flowchart
Is there an error in this question or solution?