Anda di halaman 1dari 6

1.Who is Written C++ ?

BJARNE STROUSTRUP
Stroustrup began developing C++ in 1978 (then called "C with Classes"), and, in his own
words, "invented C++, wrote its early definitions, and produced its first implementation...
chose and formulated the design criteria for C++, designed all its major facilities, and was
responsible for the processing of extension proposals in the C++ standards
committee. Stroustrup also wrote a textbook for the language, The C++ Programming
Language.
Stroustrup was the head of AT&T Bell Labs Large-scale Programming Research
department, from its creation until late 2002. Stroustrup was elected member of the National
Academy of Engineering in 2004. He is a Fellow of the ACM (1994) and an IEEE Fellow. He
works at Texas A&M University as a Distinguished Professor where he holds the College of
Engineering Endowed Chair in Computer Science. He is also a visiting faculty in Computer
Science Department at Columbia University. TMO University noble doctor since 2013
In 2015, he was made a Fellow of the Computer History Museum for his invention of the C++
programming language.

2.a) Go to
A goto statement used as unconditional jump from the goto to a labeled statement in the
same function.
Syntax:

Example #1 Go to statement :

Output :

Different type of go to :

b) While
While ( condition ) { Code to execute while the condition is true } The true represents a
boolean expression which could be x == 1 or while ( x != 7 ) (x does not equal 7). It can be
any combination of Boolean statements that are legal. Even, (while x ==5 || v == 7) which
says execute the code while x equals five or while v equals 7. Notice that a while loop is the
same as a for loop without the initialization and update sections. However, an empty
condition is not legal for a while loop as it is with a for loop.
Example :

c) Break and Continue


It causes the execution flow to jump around and because it can make the flow of logic
harder to follow
Example :

d) While True
I'm curious about using a while statement with a true condition. What is the advantage of
using a while(true) statement with break to exit the while statement over something like a for
loop? I guess I'm just curious when a good time to use this technique would be? I saw it
demonstrated in a quick sort algorithm at school today and was just curious about it. Insight?
Example :

e) Do \ White
The do...while Loop is similar to while loop with one very important difference. In
while loop, check expression is checked at first before body of loop but in case of
do...while loop, body of loop is executed first then only test expression is checked.
That's why the body of do...while loop is executed at least once.

Example :

f) Jump \ Loop
Cause a certain piece of program to be executed a certain number of
times. Consider these scenarios:

You want to execute some code/s certain number of time.

You want to execute some code/s certain number of times depending upon
input from user.

Example :

Output :

g) If \ Else
The if...else executes body of if when the test expression is true and executes the
body of else if test expression is false.

Example :

Anda mungkin juga menyukai