0% found this document useful (0 votes)
18 views3 pages

Basics of C++-WPS Office

C++ is an object-oriented programming language developed by Bjarne Stroustrup in the early 1980s, evolving from C and Simula 67. It introduces new comment symbols and uses cout for output and cin for input, with specific operators for each. The main function in C++ must return an integer value, typically ending with a return(0) statement.

Uploaded by

natapnahk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Basics of C++-WPS Office

C++ is an object-oriented programming language developed by Bjarne Stroustrup in the early 1980s, evolving from C and Simula 67. It introduces new comment symbols and uses cout for output and cin for input, with specific operators for each. The main function in C++ must return an integer value, typically ending with a return(0) statement.

Uploaded by

natapnahk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Basics of C++

C ++ is an object oriented programming language, C ++ was developed by Jarney

Stroustrup at AT & T Bell lab, USA in early eighties. C ++ was developed from c and simula 67

language. C ++ was early called ‘C with classes’.

C++ Comments:

C++ introduces a new comment symbol //(double slash). Comments start with a

double slash symbol and terminate at the end of line. A comment may start any where in the line and

what ever follows till the end of line is ignored. Note that there is no closing symbol.

The double slash comment is basically a single line comment. Multi line comments can be

written as follows:

// this is an example of

// c++ program

// thank you

The c comment symbols /* ….*/ are still valid and more suitable for multi line comments.

/* this is an example of c++ program */

Output Operator:
The statement cout <<”Hello, world” displayed the string with in quotes on the screen. The identifier

cout can be used to display individual characters, strings and even numbers. It is a predefined object

that corresponds to the standard output stream. Stream just refers to a flow of data and the standard

Output stream normally flows to the screen display. The cout object, whose properties are defined in

iostream.h represents that stream. The insertion operator << also called the ‘put to’ operator directs

the information on its right to the object on its left.

Return Statement:

In C++ main ( ) returns an integer type value to the operating system. Therefore every main (

) in C++ should end with a return (0) statement, otherwise a warning or an error might occur.

Input Operator:

The statement

cin>> number 1;

is an input statement and causes. The program to wait for the user to type in a number. The number

keyed in is placed in the variable number1. The identifier cin is a predefined object in C++ that

corresponds to the standard input stream. Here this stream represents the key board.

The operator >> is known as get from operator. It extracts value from the keyboard
and assigns it to the variable on its right.

You might also like