Prog Assignment (Ai)
Prog Assignment (Ai)
Assignment 1
Programming Fundamentals
_____________________________________________
_____________________________________________
Definition:
An algorithm is a step-by-step process or set of rules for solving a particular problem or
completing a specific task. In programming and computer science, an algorithm is a logical
sequence of actions that are used to accomplish a goal, like sorting a list, finding the shortest path,
or calculating the average of a set of numbers.
Algorithm:
1. Start.
2. Input a number i assigning a value (example: 0).
3. Compare i with a value given by user (let it be 5).
o If i<5, then it will print “*” and hence the process will be forwarded to next step.
o Otherwise, the program ends.
4. Output will be “*”.
5. End.
(It is noted that the given flowchart is according to c language and it’s a loop. The
program won’t end unless i becomes greater than 5).
Flowchart: