Professional Documents
Culture Documents
INTRODUCTION TO C++
What is C++
C++ is an intermediate level of programming
language which can support to encapsulate both high
and low level language feature.
It can support object oriented programming language.
Code
Explaination
/* Comments*/
#include<iostream>
Preprocessor directive.
It tells the preprocessor to include the
contents of iostream header file in the
program before the compilation. This file is
required for input output statements.
int/void
Return value
main()
Continue.
Code
Explaination
cout<<
cin>>
return 0;
; (semicolon)
endl;
\n
Description
char
Int
Integer.
Short
Short integer.
Long
Long integer.
Float
Decimal number
Double
Can consists of
capital letters A-Z
lowercase letters a-z
Digit 0-9
Underscore character
Not allowed
blank space
Special characters (#,$)
C++ keyword cannot be used
Example
/* variable definition and initialization */
int width, height=5;
char letter='A';
float age, area;
double d;
/* actual initialization */
width = 10;
age = 26.5;
C++ Constant
Automatic
External
Static
register
Automatic
C++ operators
Arithmetic Operators :
Operator
Description
Addition
Subtraction
Multiplication
Division
Modulus
Description
++
Increment
Decrement
Relational Operators
Operators
Description
==
Is equal to
!=
Is not equal to
>
Greater than
<
Less than
>=
<=
Logical Operators
Operato Description
r
&&
||
KEYWORDS
TUTORIALS