SlideShare a Scribd company logo
Procedure Oriented programming Object Oriented programming  Basic Concept of Object Oriented programming A simple C++ Program  Structure of C++ Program
 Procedure Oriented programming
 Object Oriented programming
 Basic Concept of Object Oriented programming
 A simple C++ Program
 Structure of C++ Program
 Application of C++
C was developed by Dennis Ritchie between the year 1969
and 1973 at AT&T Bell Labs.
C++ was developed by Bjarne Stroustrup in 1979.
For the development of code, C supports procedural
programming.
C++ is known as hybrid language because C++ supports
both procedural and object oriented programming
paradigms.
C is a function driven language because C is a procedural
programming language.
C++ is an object driven language because it is an object
oriented programming.
Standard IO header is stdio.h. Standard IO header is iostream.h.
scanf() and printf() functions are used for input/output in C.
cin and cout are used for input/output in C++
There are 32 keywords in the C There are 97 keywords in the C++
File extension is “.c” File extension is “.cpp” or “.c++” or “.cc” or “.cxx”
C structures don’t have access modifiers. C ++ structures have access modifiers.
Direct support for exception handling is not supported by C. Exception handling is supported by C++.
Object Oriented programming
C++ is a cross-platform language that can be used to create
high-performance applications.
C++ was developed as an extension of C, and both languages
have almost the same syntax.
The main difference between C and C++ is that C++ support
classes and objects, while C does not.
C++ was developed by Bjarne Stroustrup, as an extension to
the C language.
C++ gives programmers a high level of control over system
resources and memory.
The language was updated 4 major times in 2011, 2014, 2017,
and 2020 to C++11, C++14, C++17, C++20.
Why Use C++
 C++ is one of the world's most popular programming languages.
 C++ can be found in today's operating systems, Graphical User
Interfaces, and embedded systems.
 C++ is an object-oriented programming language which gives a
clear structure to programs and allows code to be reused, lowering
development costs.
 C++ is portable and can be used to develop applications that can be
adapted to multiple platforms.
 C++ is fun and easy to learn!
 As C++ is close to C, C# and Java, it makes it easy for programmers
to switch to C++ or vice versa.
C++ Variables
Variables are containers for storing data values.
In C++, there are different types of variables (defined with different keywords),
int -
stores integers (whole numbers), without decimals, such as 123 or -123
double -
stores floating point numbers, with decimals, such as 19.99 or -19.99
char -
stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes
string -
stores text, such as "Hello World". String values are surrounded by double quotes
bool -
stores values with two states: true or false
Declaring (Creating) Variables
Declare Many Variables
C++ Identifiers
 All C++ variables must be identified with unique names.
 These unique names are called identifiers.
 Identifiers can be short names (like x and y) or more descriptive
names (age, sum, totalVolume).
 The general rules for naming variables are:
 Names can contain letters, digits and underscores
 Names must begin with a letter or an underscore (_)
 Names are case-sensitive (myVar and myvar are different variables)
 Names cannot contain whitespaces or special characters like !, #, %,
etc.
 Reserved words (like C++ keywords, such as int) cannot be used as
names
Example
A simple C++ Program
#include<iostream.h>
includes the standard input output library functions.
It provides cin and cout methods for reading from
input and writing to output respectively.
#include <conio.h>
includes the console input output library functions.
The getch() function is defined in conio.h file.
void main()
The main() function is the entry point of every
program in C++ language. The void keyword
specifies that it returns no value.
cout << "Welcome to C++ Programming."
is used to print the data "Welcome to C++ Program
ming." on the console.
getch()
The getch() function asks for a single character. Until
you press any key, it blocks the screen.
Constants
continue
Constants
When you declare a constant variable, it must be assigned with a value:
const int minutesPerHour = 60;
C++ User Input
 cout is used to output (print) values. Now we will
use cin to get user input.
cin is a predefined variable that reads data from
the keyboard with the extraction operator (>>).
cout is pronounced "see-out". Used for output,
and uses the insertion operator (<<)
cin is pronounced "see-in". Used for input, and
uses the extraction operator (>>)
Basic Concept of Object Oriented programming
CLASS AND OBJECT
FRUIT
APPLE
OBJECT
GRAPES
OBJECT
MANGO
OBJECT
BANANA
OBJECT
Class
(Fruit)
Classes and objects are the two main
aspects of object-oriented
programming.
A class is a template for objects, and
an object is an instance of a class.
When the individual objects are
created, they inherit all the variables
and functions from the class.
• Encapsulation in C++ is defined
as the wrapping up of data
and information in a single
unit.
• In Object Oriented
Programming, Encapsulation is
defined as binding together
the data and the functions
that manipulate them.
• Two Important property of
Encapsulation
Data Protection
Information Hiding
Data Abstraction
 Data Abstraction is a process of providing only the essential details to the
outside world and hiding the internal details, i.e., representing only the
essential details in the program.
 Let's take a real life example of AC, which can be turned ON or OFF, change
the temperature, change the mode, and other external components such as fan,
swing. But, we don't know the internal details of the AC, i.e., how it works
internally. Thus, we can say that AC seperates the implementation details from
the external interface.
Polymorphism
• The word “polymorphism” means
having many forms
Polymorphism is considered one
of the important features of
Object-Oriented Programming..
• A real-life example of
polymorphism is a person who at
the same time can have different
characteristics. A man at the same
time is a father, a husband, and an
employee. So the same person
exhibits different behavior in
different situations. This is called
polymorphism.
INHERITANCE
Inheritance is one of the key features of Object-oriented programming in C++.
It allows us to create a new class (derived class) from an existing class
(base class).
The derived class inherits the features from the base class and can have
additional features of its own.
 Inheritance is an is-a relationship. We use inheritance only if an is-a
relationship is present between the two classes.
 Here are some examples:
 A car is a vehicle.
 Orange is a fruit.
 A surgeon is a doctor.
 A dog is an animal.
The derived class inherits the features from the base class
Derived Classes
Types Of Inheritance
Application of C++
 Google: C++ is used for lots of google magic like Big table, Google file system,
Google Chromium browser, and MapReduce large cluster data processing are all
written in C++.
 Mozilla uses a subset of C++. C++ 14 is required to build Mozilla 59, Mozilla
Firefox, and Thunderbird email chat client are both written using C++.
 Microsoft: Lots of windows apps that you regularly use are written in C++, It
features tools for developing and debugging C++ code, especially code written for
the DirectX, Windows API, and .NET.
 Rockstar Games: Almost all major game companies use C++ due to its right speed
on bare metal. Many major game engines are fully written in C++ and leverage its
speed and OOPs capabilities.
 MongoDB: MongoDB is an open-source database, widely used as the back-end
store for web applications, as well as in large enterprises like Viacom,
biotechnology giants, and Disney.
 Games and Animations: C++ is used for developing games. It simplifies the
complexity of 3-Dimensional games and helps in optimizing the resources.

More Related Content

Similar to Procedure Oriented programming Object Oriented programming Basic Concept of Object Oriented programming A simple C++ Program Structure of C++ Program (20)

1. Introduction to C++ and brief history
1. Introduction to C++ and brief history1. Introduction to C++ and brief history
1. Introduction to C++ and brief history
Ahmad177077
 
Introduction to c++ programming language
Introduction to c++ programming languageIntroduction to c++ programming language
Introduction to c++ programming language
Ahmad177077
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
Prof. Dr. K. Adisesha
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
Prof. Dr. K. Adisesha
 
C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...
C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...
C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...
vyshnavzpradeep619
 
PRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptxPRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptx
SajalKesharwani2
 
Assignment of c++ programming language 2016.doc
Assignment of c++ programming language 2016.docAssignment of c++ programming language 2016.doc
Assignment of c++ programming language 2016.doc
NuraMohamed9
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
Danielle780357
 
C++ language basic
C++ language basicC++ language basic
C++ language basic
Waqar Younis
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
Mohammed Khan
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
PushkarNiroula1
 
c programming, internshala training , govt engineering college aurangabad
c programming, internshala training , govt engineering college aurangabadc programming, internshala training , govt engineering college aurangabad
c programming, internshala training , govt engineering college aurangabad
Pysh1
 
Oops index
Oops indexOops index
Oops index
Hitesh Wagle
 
introductiontocprogramming datatypespp.pptx
introductiontocprogramming datatypespp.pptxintroductiontocprogramming datatypespp.pptx
introductiontocprogramming datatypespp.pptx
nandemprasanna
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
Manoj Kumar
 
C tutorials
C tutorialsC tutorials
C tutorials
Amit Kapoor
 
Lab 1.pptx
Lab 1.pptxLab 1.pptx
Lab 1.pptx
MohammedAlobaidy16
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
AnassElHousni
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
NEHARAJPUT239591
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
meharikiros2
 
1. Introduction to C++ and brief history
1. Introduction to C++ and brief history1. Introduction to C++ and brief history
1. Introduction to C++ and brief history
Ahmad177077
 
Introduction to c++ programming language
Introduction to c++ programming languageIntroduction to c++ programming language
Introduction to c++ programming language
Ahmad177077
 
C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...
C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...
C+Comprehensive overview of the IoT system aims, architecture, challenges, ap...
vyshnavzpradeep619
 
PRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptxPRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptx
SajalKesharwani2
 
Assignment of c++ programming language 2016.doc
Assignment of c++ programming language 2016.docAssignment of c++ programming language 2016.doc
Assignment of c++ programming language 2016.doc
NuraMohamed9
 
C++ language basic
C++ language basicC++ language basic
C++ language basic
Waqar Younis
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
PushkarNiroula1
 
c programming, internshala training , govt engineering college aurangabad
c programming, internshala training , govt engineering college aurangabadc programming, internshala training , govt engineering college aurangabad
c programming, internshala training , govt engineering college aurangabad
Pysh1
 
introductiontocprogramming datatypespp.pptx
introductiontocprogramming datatypespp.pptxintroductiontocprogramming datatypespp.pptx
introductiontocprogramming datatypespp.pptx
nandemprasanna
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
Manoj Kumar
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
AnassElHousni
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
NEHARAJPUT239591
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
meharikiros2
 

Recently uploaded (20)

Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
How to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 SlidesHow to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 Slides
Celine George
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptxUnit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 EmployeeHow to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
Quiz Club of PSG College of Arts & Science
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
How to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 SlidesHow to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 Slides
Celine George
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptxUnit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 EmployeeHow to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Ad

Procedure Oriented programming Object Oriented programming Basic Concept of Object Oriented programming A simple C++ Program Structure of C++ Program

  • 2.  Procedure Oriented programming  Object Oriented programming  Basic Concept of Object Oriented programming  A simple C++ Program  Structure of C++ Program  Application of C++
  • 3. C was developed by Dennis Ritchie between the year 1969 and 1973 at AT&T Bell Labs. C++ was developed by Bjarne Stroustrup in 1979. For the development of code, C supports procedural programming. C++ is known as hybrid language because C++ supports both procedural and object oriented programming paradigms. C is a function driven language because C is a procedural programming language. C++ is an object driven language because it is an object oriented programming. Standard IO header is stdio.h. Standard IO header is iostream.h. scanf() and printf() functions are used for input/output in C. cin and cout are used for input/output in C++ There are 32 keywords in the C There are 97 keywords in the C++ File extension is “.c” File extension is “.cpp” or “.c++” or “.cc” or “.cxx” C structures don’t have access modifiers. C ++ structures have access modifiers. Direct support for exception handling is not supported by C. Exception handling is supported by C++.
  • 4. Object Oriented programming C++ is a cross-platform language that can be used to create high-performance applications. C++ was developed as an extension of C, and both languages have almost the same syntax. The main difference between C and C++ is that C++ support classes and objects, while C does not. C++ was developed by Bjarne Stroustrup, as an extension to the C language. C++ gives programmers a high level of control over system resources and memory. The language was updated 4 major times in 2011, 2014, 2017, and 2020 to C++11, C++14, C++17, C++20.
  • 5. Why Use C++  C++ is one of the world's most popular programming languages.  C++ can be found in today's operating systems, Graphical User Interfaces, and embedded systems.  C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs.  C++ is portable and can be used to develop applications that can be adapted to multiple platforms.  C++ is fun and easy to learn!  As C++ is close to C, C# and Java, it makes it easy for programmers to switch to C++ or vice versa.
  • 6. C++ Variables Variables are containers for storing data values. In C++, there are different types of variables (defined with different keywords), int - stores integers (whole numbers), without decimals, such as 123 or -123 double - stores floating point numbers, with decimals, such as 19.99 or -19.99 char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes string - stores text, such as "Hello World". String values are surrounded by double quotes bool - stores values with two states: true or false
  • 9. C++ Identifiers  All C++ variables must be identified with unique names.  These unique names are called identifiers.  Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume).  The general rules for naming variables are:  Names can contain letters, digits and underscores  Names must begin with a letter or an underscore (_)  Names are case-sensitive (myVar and myvar are different variables)  Names cannot contain whitespaces or special characters like !, #, %, etc.  Reserved words (like C++ keywords, such as int) cannot be used as names
  • 11. A simple C++ Program #include<iostream.h> includes the standard input output library functions. It provides cin and cout methods for reading from input and writing to output respectively. #include <conio.h> includes the console input output library functions. The getch() function is defined in conio.h file. void main() The main() function is the entry point of every program in C++ language. The void keyword specifies that it returns no value. cout << "Welcome to C++ Programming." is used to print the data "Welcome to C++ Program ming." on the console. getch() The getch() function asks for a single character. Until you press any key, it blocks the screen.
  • 14. Constants When you declare a constant variable, it must be assigned with a value: const int minutesPerHour = 60;
  • 15. C++ User Input  cout is used to output (print) values. Now we will use cin to get user input. cin is a predefined variable that reads data from the keyboard with the extraction operator (>>). cout is pronounced "see-out". Used for output, and uses the insertion operator (<<) cin is pronounced "see-in". Used for input, and uses the extraction operator (>>)
  • 16. Basic Concept of Object Oriented programming
  • 17. CLASS AND OBJECT FRUIT APPLE OBJECT GRAPES OBJECT MANGO OBJECT BANANA OBJECT Class (Fruit) Classes and objects are the two main aspects of object-oriented programming. A class is a template for objects, and an object is an instance of a class. When the individual objects are created, they inherit all the variables and functions from the class.
  • 18. • Encapsulation in C++ is defined as the wrapping up of data and information in a single unit. • In Object Oriented Programming, Encapsulation is defined as binding together the data and the functions that manipulate them. • Two Important property of Encapsulation Data Protection Information Hiding
  • 19. Data Abstraction  Data Abstraction is a process of providing only the essential details to the outside world and hiding the internal details, i.e., representing only the essential details in the program.  Let's take a real life example of AC, which can be turned ON or OFF, change the temperature, change the mode, and other external components such as fan, swing. But, we don't know the internal details of the AC, i.e., how it works internally. Thus, we can say that AC seperates the implementation details from the external interface.
  • 20. Polymorphism • The word “polymorphism” means having many forms Polymorphism is considered one of the important features of Object-Oriented Programming.. • A real-life example of polymorphism is a person who at the same time can have different characteristics. A man at the same time is a father, a husband, and an employee. So the same person exhibits different behavior in different situations. This is called polymorphism.
  • 21. INHERITANCE Inheritance is one of the key features of Object-oriented programming in C++. It allows us to create a new class (derived class) from an existing class (base class). The derived class inherits the features from the base class and can have additional features of its own.  Inheritance is an is-a relationship. We use inheritance only if an is-a relationship is present between the two classes.  Here are some examples:  A car is a vehicle.  Orange is a fruit.  A surgeon is a doctor.  A dog is an animal.
  • 22. The derived class inherits the features from the base class
  • 25. Application of C++  Google: C++ is used for lots of google magic like Big table, Google file system, Google Chromium browser, and MapReduce large cluster data processing are all written in C++.  Mozilla uses a subset of C++. C++ 14 is required to build Mozilla 59, Mozilla Firefox, and Thunderbird email chat client are both written using C++.  Microsoft: Lots of windows apps that you regularly use are written in C++, It features tools for developing and debugging C++ code, especially code written for the DirectX, Windows API, and .NET.  Rockstar Games: Almost all major game companies use C++ due to its right speed on bare metal. Many major game engines are fully written in C++ and leverage its speed and OOPs capabilities.  MongoDB: MongoDB is an open-source database, widely used as the back-end store for web applications, as well as in large enterprises like Viacom, biotechnology giants, and Disney.  Games and Animations: C++ is used for developing games. It simplifies the complexity of 3-Dimensional games and helps in optimizing the resources.