Introductio NTOC++: Presented By:-Pooja, Kesar, Shamli
Introductio NTOC++: Presented By:-Pooja, Kesar, Shamli
N TO C++
Presented by:- Pooja , Kesar , Shamli ,
Noopur , Shraddha
Introduction
C++ programs are fast and efficient , qualities , which helped make
C++ an extremely popular programming language
PRESENTATION TITLE 2
PRESENTATION TITLE 3
C++ Variables
This value must match the declared type, and is fixed for
the duration of the program.
PRESENTATION TITLE 5
Numerical constants
a) integer constant –declared with const keyword and has fixed integer value
e.g. const int I = 10;
b) character constant: declared with const keyword and has fixed character value
e.g. const char ='\t';
Character escape sequences: Black slash (\) alters the meaning of the character
that follows
c) Floating point constant: Also called as real constants.
e.g. const double pi = 3.14;
d) String constant: A sequence of two or more characters surrounded by
double quotes is called a string constant
e.g. char arr[5]= "abcde";
PRESENTATION TITLE 6
Compiler Tokens
Identifiers Operators
keywords Literals Constant
PRESENTATION TITLE 7
Keywords
PRESENTATION TITLE 8
Identifiers
A valid identifier is a sequence of one or more letters , digits or underline symbols (_).
Only first 32 characters of an identifier are significant and letters , digits and underline
characters are valid
PRESENTATION TITLE 9
Literals
Literals are data used for representing fixed values.
For example: 1, 2.5, 'c' etc.
PRESENTATION TITLE 10
Operators
PRESENTATION TITLE 11
Some of the important operators
2) Increment
1) Arithmetic 3) Relational 4) Logical
and decrement
operators operator operators
operators
8) Operators
5) conditional 6) assignment 7) shorthand
dealing with
operator operator operator
streams
10)Scope
9)The size of
resolution
operator
operator
PRESENTATION TITLE 12
COMMENT
S OF C++
The C++ comments are statements
that are not executed by the compiler.
The comments in C++ programming
can be used to provide explanation of
the code, variable, method or class.
By the help of comments, you can
hide the program code also.
PRESENTATION TITLE 13
If else statement
If(condition)
{
//code to be executed if condition is true
}
Else
{
//code to be executed if condition is false
}
PRESENTATION TITLE 15
Switch statement
Syntax : switch(integer_val)
{
break;
break;
PRESENTATION TITLE 16
For statement
Syntax :
for(initial_value ; test
condition ; step)
{
PRESENTATION TITLE 17
While statement
while (condition)
PRESENTATION TITLE 18
Do While statement
do
{
// code block to be executed
}
while (condition);
PRESENTATION TITLE 19
1) C++ is a _____ language
2) ____ is a unary operator
3) Char is ____ data type
4) ______ mathematical calculation
5) Where did Bjarne Stroustrup developed
C++?
6) Which operator is used to test the
relation between 2 values ?
7) Which arithmetic operator needs two
QUESTIONS operands ?
??
8) What is switch statement also called as ?
9) Write a program to display the table of 8
?
10) Write a program to add to numbers ?
PRESENTATION TITLE 20
PRESENTATION TITLE
THANK YOU
21