Вы находитесь на странице: 1из 3

ASSIGNMENT C++ PROGRAMMING

1.Who is Written C++ ?


C++ (pronounced as see plus plus, /si pls pls/) is a general-purpose programming language.
It has imperative, object-orientedand generic programming features, while also providing the
facilities for low-level memory manipulation.
It is designed with a bias toward system programming (e.g., for use in embedded
systems or operating system kernels), with performance, efficiency and flexibility of use as its
design requirements. C++ has also been found useful in many other contexts, including desktop
applications, servers (e.g. e-commerce, web search or SQL servers), performance-critical
applications (e.g.telephone switches or space probes), and entertainment software.[3] C++ is
a compiled language, with implementations of it available on many platforms and provided by
various organizations, including the FSF, LLVM, Microsoft and Intel.
C++ is standardized by the International Organization for Standardization (ISO), with the latest
(and current) standard version ratified and published by ISO in December 2014 as ISO/IEC
14882:2014 (informally known as C++14).[4] The C++ programming language was initially
standardized in 1998 as ISO/IEC 14882:1998, which was then amended by the C++03, ISO/IEC
14882:2003, standard. The current C++14 standard supersedes these and C++11, with new
features and an enlarged standard library. Before the initial standardization in 1998, C++ was
developed by Bjarne Stroustrup at Bell Labs, starting in 1979, who wanted an efficient flexible
language (like the C language), which also provided high-level features for program organization.
Many other programming languages have been influenced by C++, including C#, Java, and
newer versions of C (after 1998).

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


a.Go to
This Appendix to the C++ Programming book will attempt to provide users a complementary
practical understanding of the C++ programming language. It will be an aggregation dependent
on the lessons and theoretical content already presented on the C++ Programming book, so to
consistently list all compilable example programs that are used in the main book, this appendix

will be useful to refresh your knowledge in a hands-on approach, guarantee performance and
permit easier maintenance of the used code and test derivations of the examples used.
b. While
while ( expression )
statement

The test of expression takes place before each execution of the loop; therefore,
a while loop executes zero or more times. expression must be of an integral type, a
pointer type, or a class type with an unambiguous conversion to an integral or pointer
type.
A while loop can also terminate when a break, goto, or return within the statement body
is executed. Use continue to terminate the current iteration without exiting
the whileloop. continue passes control to the next iteration of the while loop.

c.While True
There are two statements ( break; and continue; ) built in C++ programming to alter the
normal flow of program.
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.

d. While True
The syntax of a while loop in C++ is:
while(condition)
{
statement(s);
}

Here, statement(s) may be a single statement or a block of statements. The condition may be
any expression, and true is any non-zero value. The loop iterates while the condition is true.
When the condition becomes false, program control passes to the line immediately following the
loop.

e.Do / While

The do-while loop is similar to the while loop, except that the
test condition occurs at the end of the loop. Having the test
condition at the end, guarantees that the body of the loop always
executes at least one time. The format of the do-while loop is
shown in the box at the right.
f.Jump/Loop
The FOR loop construct in Ada does not give the programmer the ability to directly modify the loop control
variable during the execution of the loop. Instead, a valid range must always be provided before entering a
loop. Because exact adherence to the task is impossible, we have three versions to approximate a solution.
Looper_1 goes through a range of values which are even. Looper_2 multiples each value by two. Looper_3
most closely adheres to the requirements of this task, and achieves this by using a second range for the
indices.
g.If / else

if ( expression )
statement1
[else
statement2]
If the value of expression is nonzero, statement1 is executed. If the optional else is
present, statement2 is executed if the value of expression is zero. expression must be of
arithmetic or pointer type, or it must be of a class type that defines an unambiguous
conversion to an arithmetic or pointer type. (For information about conversions,
seeStandard Conversions.)

Вам также может понравиться