0% found this document useful (0 votes)
37 views20 pages

Introductio NTOC++: Presented By:-Pooja, Kesar, Shamli

C++ was initially developed by Bjarne Stroustrup at Bell Labs in the early 1980s. C++ is a superset of C and fully supports object-oriented programming. C++ programs are fast and efficient, which contributed to C++ becoming an extremely popular programming language.

Uploaded by

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

Introductio NTOC++: Presented By:-Pooja, Kesar, Shamli

C++ was initially developed by Bjarne Stroustrup at Bell Labs in the early 1980s. C++ is a superset of C and fully supports object-oriented programming. C++ programs are fast and efficient, which contributed to C++ becoming an extremely popular programming language.

Uploaded by

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

INTRODUCTIO

N TO C++
Presented by:- Pooja , Kesar , Shamli ,
Noopur , Shraddha 
Introduction

Bjarne Stroustrup at Bell Labs initially developed C++ during the


early 1980's

C++ is the best described as a superset of C , with full support for


object-oriented programming . This is in wide spread use 

C++ programs are fast and efficient , qualities , which helped make
C++ an extremely popular programming language 

PRESENTATION TITLE 2
PRESENTATION TITLE 3
C++ Variables

Variables in C++ is a name given to a


memory location. It is the basic unit of
storage in a program. 

• The value stored in a variable can


be changed during program
execution.
• A variable is only a name given to a
memory location, all the operations
done on the variable effects that
memory location.
• In C++, all the variables must be
declared before use.
Constants in C++

Constant : are declared with the "const" keyword, a type ,


their name , and an assignment of their constant value 

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

Keywords are predefined words that have special meanings to


the compiler.

Keywords should be considered to be reserved . 

Keywords are not allowed to be used as variables names.

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

Case in significant and all characters are considered significant .

Language's keywords should not be used to define an identifier.

PRESENTATION TITLE 9
Literals
Literals are data used for representing fixed values. 

They can be used directly in the code.

 For example: 1, 2.5, 'c' etc.

PRESENTATION TITLE 10
Operators 

An operator does some operation on operands and


this operation is normally specified by operator's
symbol .

C++ has many operators , mainly classified as


unary operators , working on single operand and
binary , working on 2 operands .
   

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)

{   

case value_1 : //code to execute if integer_val is value_1

break;

case value_n //code to execute if integer_val is value_n

break;

Default: //codeto execute if integer_val is none of the above

PRESENTATION TITLE 16
For statement
Syntax :
for(initial_value ; test
condition ; step)
{

//code to execute inside


the loop

PRESENTATION TITLE 17
While statement

while (condition)

  // code block to be executed

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

You might also like