Professional Documents
Culture Documents
THEORY
Question: What is transfer of control? Give an example which causes transfer
of control?
• In all programs, computer executes instructions in numerical order, from smallest
to largest one.
• However the order the execution can be changed using control statements.
• One control statement is GOTO statement, that causes the control to transfer
anywhere within the program.
Example:
10 REM * ENDLESS GOTO LOOP OF WELCOME MESSAGE*
20 INPUT “PLEASE ENTER YOUR NAME:” ; A$
30 PRINT “WELCOME” ; A$
40 GOTO 30
50 END
============================================================
Visit www.eservicespakistan.com for Notes, Syllabus, Old Papers, Home Tuitions, Jobs & much more
(Page 1 of 3)
Written by: - SHAHZAD IFTIKHAR Contact # 0313-7891989, 0333-5319544
e-mail: shahzad2sunny@hotmail.com website: www.eservicespakistan.com
Question: What is the purpose of FOR statement in the FOR … NEXT loop.
Explain with example.
The purpose of FOR statement at the beginning of the loop is to name the counter
and put its initial and final values. The NEXT statement indicates the end of the loop,
increments the counter and then tests the counter.
Question: How do WHILE … WEND loop differ from FOR … NEXT loop?
FOR … NEXT loop: -
In some cases a part of a program is repeated several times. It is necessary to use a
loop to execute the part of the program repeatedly. A combination of IF … THEN and
GOTO statements can be used to perform looping.
WHILE … WEND loop: -
WHILE … WEND statements is used to execute a series of statements in a loop as
long as a given condition is true. If the condition is false, the loop ends and the
program continues to the line following EEND.
============================================================
Visit www.eservicespakistan.com for Notes, Syllabus, Old Papers, Home Tuitions, Jobs & much more
(Page 2 of 3)
Written by: - SHAHZAD IFTIKHAR Contact # 0313-7891989, 0333-5319544
e-mail: shahzad2sunny@hotmail.com website: www.eservicespakistan.com
More works/Tasks:
Do Objectives from book & from any other objective book.
Do Interesting Information from book.
Do Scientific Reasons with the help of teacher.
============================================================
Visit www.eservicespakistan.com for Notes, Syllabus, Old Papers, Home Tuitions, Jobs & much more
(Page 3 of 3)