SlideShare a Scribd company logo
 Getting started with C++
Prepared by:-
Ranjan Das & Akash deep baruah.
In 1980s bjarne Stroustrup decided to extend
the C language by adding some features from
his favourite language Simula 67. Simula 67
was one of the earliest object oriented
language. Bjarne Stroustrup called it “C with
classes”.
Later Rick Mascitti renamed as C++. Ever
since its birth, C++ evolved to cope with
problems encountered by users, and though
discussions.
 Character set is a set of valid characters that a language
can recognize. A character represents any letter, digit,
or any other sign.
Letters: A-Z, a-z
Digits: 0-9
Special Symbols: Space + - * / ^  ( ) [ ] { } = != < >
. ‘ “ $ , ; : % ! & ? _(underscore) # <= >= @
White Spaces: Blank spaces, Horizontal tab, Carriage
return, New line, Form feed.
Other Characters: C++ can process any of the 256 ASCII
characters as data or as literals.
The smallest individual unit in a program is
known as a Token or lexical unit.
Types of Tokens
 Keywords
 Identifiers
 Literals
 Punctuators
 Operators
 Keywords are the words that convey a special
meaning to the language compiler. These are
reserved for special purpose and must not be
used as normal identifier names.
asm continue float new signed try
auto default for operator sizeof typedef
break delete friend private static union
case do goto protected struct unsigned
catch double if public switch virtual
char else inline register template void
class enum int return this volatile
const extern long short throw while
 Identifiers are names of the program given by
user.
Rules to write identifiers
1. Do not start with digits.
2. No special symbols are used except
_(underscore).
3. No spaces are used.
Examples:- myfile , date9_2_7_6
 Literals (constants) are data items that never
change their value during a program run.
Types of Literals:
1. Integer constant
2. Floating constants
3. Character constant
4. String literal
 Integer constants are whole numbers without
any fractional part.
Three types of Integer constants
1. Decimal Integer constant
2. Octal Integer constant
3. Hexadecimal Integer constant
 An integer constant consisting of a sequence of
digits is taken to be decimal integer constant unless
it begins with 0 (digit zero).
Example:- 1296, 5642, 12, +69,- 23,etc.,
 A sequence of digits starting with0(digit zero) is
taken to be an octal integer.
Example:-123, 456, etc.,
 A sequence of digits preceded by 0x or 0X is taken
to be an hexadecimal integer.
Example:-4B6, A43,etc.,
 Floating constants are also called as Real
constants
Real constants are numbers having fractional
parts. These may be written in one of the two
forms called fractional form or the exponent form.
Examples:-2.0, 3.5, 8.6, etc.,
 A Character constant is one character enclosed
in single quotes, as in ‘z’.
Examples:- ‘a’, ‘b’, etc.,
a Audible sound
b back space
f Formfeed
n Newline or Linefeed
r Carriage return
t Horizontal tab
v Vertical tab
 Backslash
’ single quote
” double quote
? Question mark
on Octal number
xHn Hexadecimal number
0 Null
 Multiple character constants are treated as string
literals.
Examples:-”a” , “ade”, etc.,
 The following characters are used as
punctuators.
 [ ] ( ) { } , ; : * … = #
 Brackets [ ] opening and closing brackets
indicate single and multidimensional array
subscripts.
 Parenthesis ( ) these indicate function calls
and function parameters.
 Braces { } these indicates the start and end of a
compound statement.
 Comma , it is used as separator in a function
argument list.
 Semicolon ; it is used as statement
terminator.
 Colon : it indicates a labeled statement.
 Asterisk * it is used for pointer declaration.
 Ellipsis … Ellipsis (...) are used in the formal
argument lists of the function prototype to
indicate a variable number of argument.
 Equal to sign = It is used for variable
initialization and an assignment operator in
expressions.
 Pound sign # this sign is used for
preprocessor directive.
 Operators are tokens that trigger some
computation when applied to variables and
other objects in an expression.
Types of operators
1. Unary operators
2. Binary operators
3. Ternary operators
 Unary operators are those operators that
require one operator to operate upon.
 Examples :- +45, 5, -636,etc.,
& Addresser operator
* Indirection operator
+ Unary plus
- Unary minus
~ Bitwise complement
++ increment operator
-- decrement operator
! Logical negation
 Binary operators are those operators that
require two operands to operate upon.
 Types of Binary operators
 Arithmetic operators
+(addition) –(subtraction) *(multiplication)
/(division) %(reminder/modulus)
 Logical operators
&& (Logical AND) || (Logical OR)
 Relational operators
< (Less than)
<=(Less than or equal to)
>(Greater than)
>=(greater than or equal to)
== (equal to)
!= (not equal to)
 Why include iostream.h ?
The header file iostream.h is included in every
C++ program to implement input/output
facilities. Input/output facilities are not
defined within C++ language, but rather are
implemented in a component of C++ standard
library, iostream.h which is I/O library.
 A stream is simply a sequence of bytes.
The predefined stream objects for input, output,
error as follows:
1. Cin cin stands for console input.
2. Cout cout stands for console output.
3. Cerr cerr stands for console error.
 Comments are pieces of codes that the
compiler discards or ignores or simply does
not execute.
 Types of comments:
1. Single line comments
2. Multiline or block comments
 These comments begins with // are single line
comments. The compiler simply ignores
everything following // in that same line
 Example:-
#include<iostream.h>
Void main() // the program about addition.
 The block comments, mark the beginning of
comment with /* and end with */. That means,
everything that falls between/* and*/ is
considered as comment.
Example:-
#include<iostream.h>
Void main() /*the program is about addition*/
 Output operator “ << “
 The output operator (“<<“), also called
stream insertion operator is used to direct a value
top standard output.
 Input operator “ >> ”
 The input operator(“>>“), also known as
stream extraction operator is used to read a value
from standard input.
Variable
 A variable refers to a storage area whose
contents can vary during processing.
Cascading of I/O operators
 The multiple use of input or output
operators(“>>”or”<<“) in one statement is
called cascading of I/O operators.
 A part of the compiler’s job is to analyze the
program code for ‘correctness’. If the meaning
of the program is correct, then a compiler can
not detect errors.
Types of errors:
1. Syntax Errors
2. Semantic Errors
3. Type Errors
4. Run-time Errors
5. Logical Errors
 Syntax Errors are occurred when rules of the
program is misused i.e., when grammatical rule
of C++ is violated.
Ex:- int a, b (semicolon missing)
 Semantic Errors are occur when statements not
meaningful.
Ex:- x*y=z;
 Type Errors are occurred when the data types
are misused.
 Ex:-int a; a=123.56;
 Run-time Errors are occurred at the time of
execution.
 Logical Errors are occurred when the logic of
program is not proper.
Ex:- ctr=1;
While (ctr>10)
{
cout<<n*ctr;
ctr=ctr+1;
}
Getting started with c++.pptx

More Related Content

What's hot

LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
DataminingTools Inc
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
Manisha Keim
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
KRUNAL RAVAL
 
Data type in c
Data type in cData type in c
Data type in c
thirumalaikumar3
 
Strings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiStrings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothi
Sowmya Jyothi
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
Rai University
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
 
C++
C++C++
C++
k v
 
Module 1:Introduction
Module 1:IntroductionModule 1:Introduction
Module 1:Introduction
nikshaikh786
 
Unit 2. Elements of C
Unit 2. Elements of CUnit 2. Elements of C
Unit 2. Elements of C
Ashim Lamichhane
 
Assignment5
Assignment5Assignment5
Assignment5
Sunita Milind Dol
 
Assignment2
Assignment2Assignment2
Assignment2
Sunita Milind Dol
 
C Tokens
C TokensC Tokens
C Tokens
Ripon Hossain
 
C Token’s
C Token’sC Token’s
C Token’s
Tarun Sharma
 
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdfSTRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
 
Module 3-Functions
Module 3-FunctionsModule 3-Functions
Module 3-Functions
nikshaikh786
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data types
Pratik Devmurari
 
2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++
Kuntal Bhowmick
 
Constants and variables in c programming
Constants and variables in c programmingConstants and variables in c programming
Constants and variables in c programming
Chitrank Dixit
 

What's hot (20)

LISP: Input And Output
LISP: Input And OutputLISP: Input And Output
LISP: Input And Output
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
 
Data type in c
Data type in cData type in c
Data type in c
 
Strings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiStrings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothi
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
C++
C++C++
C++
 
Module 1:Introduction
Module 1:IntroductionModule 1:Introduction
Module 1:Introduction
 
Unit 2. Elements of C
Unit 2. Elements of CUnit 2. Elements of C
Unit 2. Elements of C
 
Assignment5
Assignment5Assignment5
Assignment5
 
Assignment2
Assignment2Assignment2
Assignment2
 
C Tokens
C TokensC Tokens
C Tokens
 
C Token’s
C Token’sC Token’s
C Token’s
 
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdfSTRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
Module 3-Functions
Module 3-FunctionsModule 3-Functions
Module 3-Functions
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data types
 
2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++
 
Constants and variables in c programming
Constants and variables in c programmingConstants and variables in c programming
Constants and variables in c programming
 

Similar to Getting started with c++.pptx

Ch02
Ch02Ch02
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
Likhil181
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
valarpink
 
Getting started with C++
Getting started with C++Getting started with C++
Getting started with C++
Asirbachan Sutar
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
MamataAnilgod
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++
Aahwini Esware gowda
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
floraaluoch3
 
Token and operators
Token and operatorsToken and operators
Token and operators
Samsil Arefin
 
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic  4rth semester nots jjava or oops class not in kerala polytechnic  4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
ishorishore
 
C++ lecture 01
C++   lecture 01C++   lecture 01
C++ lecture 01
HNDE Labuduwa Galle
 
C-PROGRAM
C-PROGRAMC-PROGRAM
C-PROGRAM
shahzadebaujiti
 
1 Revision Tour
1 Revision Tour1 Revision Tour
1 Revision Tour
Praveen M Jigajinni
 
B.sc CSIT 2nd semester C++ Unit2
B.sc CSIT  2nd semester C++ Unit2B.sc CSIT  2nd semester C++ Unit2
B.sc CSIT 2nd semester C++ Unit2
Tekendra Nath Yogi
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
Tareq Hasan
 
C programming language
C programming languageC programming language
C programming language
Mahmoud Eladawi
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
madhurij54
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary Programming
Eric Chou
 
C introduction
C introductionC introduction
C introduction
AswathyBAnil
 
C language
C languageC language
C language
SMS2007
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
20EUEE018DEEPAKM
 

Similar to Getting started with c++.pptx (20)

Ch02
Ch02Ch02
Ch02
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
Getting started with C++
Getting started with C++Getting started with C++
Getting started with C++
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
 
Token and operators
Token and operatorsToken and operators
Token and operators
 
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic  4rth semester nots jjava or oops class not in kerala polytechnic  4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
 
C++ lecture 01
C++   lecture 01C++   lecture 01
C++ lecture 01
 
C-PROGRAM
C-PROGRAMC-PROGRAM
C-PROGRAM
 
1 Revision Tour
1 Revision Tour1 Revision Tour
1 Revision Tour
 
B.sc CSIT 2nd semester C++ Unit2
B.sc CSIT  2nd semester C++ Unit2B.sc CSIT  2nd semester C++ Unit2
B.sc CSIT 2nd semester C++ Unit2
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
 
C programming language
C programming languageC programming language
C programming language
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary Programming
 
C introduction
C introductionC introduction
C introduction
 
C language
C languageC language
C language
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 

Recently uploaded

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 

Recently uploaded (20)

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 

Getting started with c++.pptx

  • 1.  Getting started with C++ Prepared by:- Ranjan Das & Akash deep baruah.
  • 2. In 1980s bjarne Stroustrup decided to extend the C language by adding some features from his favourite language Simula 67. Simula 67 was one of the earliest object oriented language. Bjarne Stroustrup called it “C with classes”. Later Rick Mascitti renamed as C++. Ever since its birth, C++ evolved to cope with problems encountered by users, and though discussions.
  • 3.  Character set is a set of valid characters that a language can recognize. A character represents any letter, digit, or any other sign. Letters: A-Z, a-z Digits: 0-9 Special Symbols: Space + - * / ^ ( ) [ ] { } = != < > . ‘ “ $ , ; : % ! & ? _(underscore) # <= >= @ White Spaces: Blank spaces, Horizontal tab, Carriage return, New line, Form feed. Other Characters: C++ can process any of the 256 ASCII characters as data or as literals.
  • 4. The smallest individual unit in a program is known as a Token or lexical unit. Types of Tokens  Keywords  Identifiers  Literals  Punctuators  Operators
  • 5.  Keywords are the words that convey a special meaning to the language compiler. These are reserved for special purpose and must not be used as normal identifier names.
  • 6. asm continue float new signed try auto default for operator sizeof typedef break delete friend private static union case do goto protected struct unsigned catch double if public switch virtual char else inline register template void class enum int return this volatile const extern long short throw while
  • 7.  Identifiers are names of the program given by user. Rules to write identifiers 1. Do not start with digits. 2. No special symbols are used except _(underscore). 3. No spaces are used. Examples:- myfile , date9_2_7_6
  • 8.  Literals (constants) are data items that never change their value during a program run. Types of Literals: 1. Integer constant 2. Floating constants 3. Character constant 4. String literal
  • 9.  Integer constants are whole numbers without any fractional part. Three types of Integer constants 1. Decimal Integer constant 2. Octal Integer constant 3. Hexadecimal Integer constant
  • 10.  An integer constant consisting of a sequence of digits is taken to be decimal integer constant unless it begins with 0 (digit zero). Example:- 1296, 5642, 12, +69,- 23,etc.,
  • 11.  A sequence of digits starting with0(digit zero) is taken to be an octal integer. Example:-123, 456, etc.,
  • 12.  A sequence of digits preceded by 0x or 0X is taken to be an hexadecimal integer. Example:-4B6, A43,etc.,
  • 13.  Floating constants are also called as Real constants Real constants are numbers having fractional parts. These may be written in one of the two forms called fractional form or the exponent form. Examples:-2.0, 3.5, 8.6, etc.,
  • 14.  A Character constant is one character enclosed in single quotes, as in ‘z’. Examples:- ‘a’, ‘b’, etc.,
  • 15. a Audible sound b back space f Formfeed n Newline or Linefeed r Carriage return t Horizontal tab v Vertical tab Backslash ’ single quote ” double quote ? Question mark on Octal number xHn Hexadecimal number 0 Null
  • 16.  Multiple character constants are treated as string literals. Examples:-”a” , “ade”, etc.,
  • 17.  The following characters are used as punctuators.  [ ] ( ) { } , ; : * … = #  Brackets [ ] opening and closing brackets indicate single and multidimensional array subscripts.  Parenthesis ( ) these indicate function calls and function parameters.
  • 18.  Braces { } these indicates the start and end of a compound statement.  Comma , it is used as separator in a function argument list.  Semicolon ; it is used as statement terminator.  Colon : it indicates a labeled statement.  Asterisk * it is used for pointer declaration.
  • 19.  Ellipsis … Ellipsis (...) are used in the formal argument lists of the function prototype to indicate a variable number of argument.  Equal to sign = It is used for variable initialization and an assignment operator in expressions.  Pound sign # this sign is used for preprocessor directive.
  • 20.  Operators are tokens that trigger some computation when applied to variables and other objects in an expression. Types of operators 1. Unary operators 2. Binary operators 3. Ternary operators
  • 21.  Unary operators are those operators that require one operator to operate upon.  Examples :- +45, 5, -636,etc.,
  • 22. & Addresser operator * Indirection operator + Unary plus - Unary minus ~ Bitwise complement ++ increment operator -- decrement operator ! Logical negation
  • 23.  Binary operators are those operators that require two operands to operate upon.  Types of Binary operators  Arithmetic operators +(addition) –(subtraction) *(multiplication) /(division) %(reminder/modulus)  Logical operators && (Logical AND) || (Logical OR)
  • 24.  Relational operators < (Less than) <=(Less than or equal to) >(Greater than) >=(greater than or equal to) == (equal to) != (not equal to)
  • 25.  Why include iostream.h ? The header file iostream.h is included in every C++ program to implement input/output facilities. Input/output facilities are not defined within C++ language, but rather are implemented in a component of C++ standard library, iostream.h which is I/O library.
  • 26.  A stream is simply a sequence of bytes. The predefined stream objects for input, output, error as follows: 1. Cin cin stands for console input. 2. Cout cout stands for console output. 3. Cerr cerr stands for console error.
  • 27.  Comments are pieces of codes that the compiler discards or ignores or simply does not execute.  Types of comments: 1. Single line comments 2. Multiline or block comments
  • 28.  These comments begins with // are single line comments. The compiler simply ignores everything following // in that same line  Example:- #include<iostream.h> Void main() // the program about addition.
  • 29.  The block comments, mark the beginning of comment with /* and end with */. That means, everything that falls between/* and*/ is considered as comment. Example:- #include<iostream.h> Void main() /*the program is about addition*/
  • 30.  Output operator “ << “  The output operator (“<<“), also called stream insertion operator is used to direct a value top standard output.  Input operator “ >> ”  The input operator(“>>“), also known as stream extraction operator is used to read a value from standard input.
  • 31. Variable  A variable refers to a storage area whose contents can vary during processing. Cascading of I/O operators  The multiple use of input or output operators(“>>”or”<<“) in one statement is called cascading of I/O operators.
  • 32.  A part of the compiler’s job is to analyze the program code for ‘correctness’. If the meaning of the program is correct, then a compiler can not detect errors. Types of errors: 1. Syntax Errors 2. Semantic Errors 3. Type Errors 4. Run-time Errors 5. Logical Errors
  • 33.  Syntax Errors are occurred when rules of the program is misused i.e., when grammatical rule of C++ is violated. Ex:- int a, b (semicolon missing)  Semantic Errors are occur when statements not meaningful. Ex:- x*y=z;  Type Errors are occurred when the data types are misused.  Ex:-int a; a=123.56;
  • 34.  Run-time Errors are occurred at the time of execution.  Logical Errors are occurred when the logic of program is not proper. Ex:- ctr=1; While (ctr>10) { cout<<n*ctr; ctr=ctr+1; }