Assignment C++ Programming
Assignment C++ Programming
KFC 1024
ASSIGNMENT
(C++ PROGRAMMING)
DISEDIAKAN UNTUK:
ENCIK MOHD SHUKRI BIN MUHAMMAD HUSIN
DISEDIAKAN OLEH:
SITI ROKIAH BINTI MOHD NOH
1601058
PROGRAM:
SIJIL TEKNOLOGI KEJURUTERAAN KOMPUTER
(RANGKAIAN)
SESI:
SEM 1
JANUARI JUN 2016
QUESTION:
1. Who is Written C++?
b) While
A while loop statement repeatedly executes a target statement as
long as a given condition is trus.
d) While True
While true means that the loop will iterate forever, unless some
command inside the loop forces the loop to end. In this case, the
break on line 11 will force the loop to end.
e) Do / While
A do while loop is similar to a while loop, except that a do
while loop is guaranteed to execute at least one time.
f) Jump / Loop
The initialization statement is executed only once at the beginning
of the for loop. Then the test expression is checked by the
program. If the test expression is false, for the loop is terminated.
But if test expression is true then the code/s inside body of for loop
is executed and then update expression is updated. This process
repeats until test expression is false.
g) If / else
An if statement can be followed by an optional else statement,
which executes when the Boolean expression is false.