Sunteți pe pagina 1din 7

ASSIGNMENT : C++ PROGRAMMING

QUESTIONS
1.

Who is written C++?


Bjarne Stroustrup (Danish: born 30 December 1950) is a
Danish computer scientist, most notable for the creation and
development of the widely used C++ programming language.
He is a Distinguished Research Professor and holds the College
of Engineering Chair in Computer Science at Texas A&M
University, is a visiting professor at Columbia University, and
works at Morgan Stanley as a Managing Director in New York.

Education: Stroustrup has a master's degree in mathematics


and computer science (1975) from Aarhus University, Denmark,
and a Ph.D. in computer science (1979) from the University of
Cambridge, England. His thesis advisor in Cambridge was David
Wheeler.

Career: 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. ITMO 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.

State statements below and give an example application in C++ Program.


a) Go to
In C++ programming, goto statement is used for altering the normal
sequence of program execution by transferring control to some other part of
the program.

Syntax of goto Statement

Example go to

b) While
In computer programming, 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.
There are 3 types of loops in C++ Programming:
for Loop
while Loop
do...while Loop

Syntax of while

Example While

c) Break And continue


Loops are used to perform repetitive task until test expression is false but
sometimes it is desirable to skip some statement/s inside loop or terminate
the loop immediately with checking test condition. On these type of
scenarios,continue; statement and break; statement is used respectively.
The break;statement is also used to terminate switch statement.

C++ Break Statement


The break; statement terminates the loop(for, while and do..while loop) and
switch statement immediately when it appears.

Syntax of break

Example

C++ continue Statement


It is sometimes necessary to skip some statement/s inside the loop. In
that case,continue; statement is used in C++ programming.

Syntax of continue

Example

d) While True
A while loop statement repeatedly executes a target statement as long as a given
condition is true.

Syntax:

Example while true

e)

Do / While
Unlike for and while loops, which test the loop condition at the top of the loop,
the do...while loop checks its condition at the bottom of the loop.
A do...while loop is similar to a while loop, except that a do...while loop is guaranteed to
execute at least one time.

Syntax:

Example

f) Jump / Loop
A C++ jump statement performs an immediate local transfer of control.

Syntax

g) If / else
An if statement can be followed by an optional else statement, which executes when
the boolean expression is false.

Syntax:

Example

S-ar putea să vă placă și