Docsity

Algorithm Questions with Answers, Exercises of Algorithms and Programming

Toggle sidebar
bg1
Algorithm Questions with Answers
1- Print Hello World 10 Times
Structured English:
BEGIN
Counter EQUAL 0
IF Counter EQUAL or GREATER 10
REPEAT
WRITE “Hello World”
Counter EQUAL Counter PLUS 1
END REPEAT
END IF
END
Pseudocode:
Counter = 0
If (counter<10)
Repeat
Print “Hello World”
Counter = Counter + 1
End Repeat
End If
Flowchart:
pf3
pf4
pf5

Partial preview of the text

Download Algorithm Questions with Answers and more Exercises Algorithms and Programming in PDF only on Docsity!

Algorithm Questions with Answers 1 - Print Hello World 10 Times Structured English: BEGIN Counter EQUAL 0 IF Counter EQUAL or GREATER 10 REPEAT WRITE “Hello World” Counter EQUAL Counter PLUS 1 END REPEAT END IF END Pseudocode: Counter = 0 If (counter<10) Repeat Print “Hello World” Counter = Counter + 1 End Repeat End If Flowchart:

2 - Find the sum of 5 numbers entered by user Structured English: BEGIN Cnt EQUAL 0 Sum EQUAL 0 IF Cnt EQUAL or GREATER 5 REPEAT WRITE “Please Enter 5 Number to Sum up all” GET number Counter EQUAL Counter PLUS 1 Sum EQUAL Sum PLUS Number END REPEAT END IF END Pseudocode:? Flowchart: