SlideShare a Scribd company logo
Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423 603
(An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune)
NAAC ‘A’Grade Accredited, ISO 9001:2015 Certified
Department of Computer Engineering
(NBA Accredited)
Subject- Object Oriented Programming (CO212) Unit 1 –
Fundamentals of OOP
Topic – 1.4 C++ Programming Basics
Prof. V.N.Nirgude
Assistant Professor
Email:
nirgudevikascomp@sanjivani.org.in
Contact No: 9975240215
What is C++?
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 2
◼ C++ is a compiled, object-oriented language
◼ It is the “successor” to C,
◼ (the “++” is called the successor operator in C++)
◼ C was derived from a language called B which
derived from BCPL
was in turn
◼ C was developed in the 1970’s by Dennis
Bell Labs
Ritchie of AT&T
◼ C++ was developed in the early
Stroustrup of AT&T Bell Labs.
1980’s by Bjarne
◼ Most of C is a subset of C++
Simple C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 3
#include <iostream>
int main()
{
// Declarations
// Statements
return 0;
}
◼ Compiler directive:
Tells the compiler
what to do before
compiling
◼ This one includes
source code from
another file
Simple C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 4
#include <iostream>
int main()
{
// Declarations
// Statements
return 0;
}
◼ Main function
Simple C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 5
#include <iostream>
int main()
{
// Declarations
// Statements
return 0;
}
◼ Header for
main function
◼ States…
◼ data type for the
return value
◼ identifier for function
◼ list of arguments
between parenthesis
(none for this
function)
Simple C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 6
#include <iostream>
int main()
{
// Declarations
// Statements
return 0;
}
◼ Braces enclose the
body of the function
◼ They represent the
start and end of the
function
Simple C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 7
#include <iostream>
int main()
{
// Declarations
// Statements
return 0;
}
◼ Declarations and
statements
◼ Main body of function
◼ “//” represents the start
of a comment
Simple C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 8
#include <iostream>
int main()
{
// Declarations
// Statements
return 0;
}
Return statement:
◼ specifies the value the
function returns
◼ All (almost) declarations
and statements end with
a semi-colon “;”
Simple C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 9
#include <iostream>
int main()
{
// Declarations
// Statements
return 0;
}
◼ This program
doesn’t do
anything!
Sample C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 10
#include <iostream>
int main()
{
int number;
cout << “Enter a number” <<endl;
cin >> number;
cout << “You entered: “ <<number;
return 0;
}
Variable declaration:
◼ The identifier
number is declared
as being of data type
int
Sample C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 11
#include <iostream>
int main()
{
int number;
cout << “Enter a number” <<endl;
cin >> number;
cout << “You entered: “ <<number;
return 0;
}
◼ cout:
the output statement for
C++
◼ Note the direction of
“<<“
◼ endl:
represents an end-of-line
Sample C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 12
#include <iostream>
int main()
{
int number;
cout << “Enter a number” <<endl;
cin >> number;
cout << “You entered: “ <<number;
return 0;
}
◼ cin:
the input statement
for C++
◼ Note the direction
of “>>”
Sample C++ Program
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 13
#include <iostream>
int main()
{
int number;
cout << “Enter a number” <<endl;
cin >> number;
cout << “You entered: “ <<number;
return 0;
}
Output:
Enter a number:
10
You entered:10
Thank You..
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 14

More Related Content

PPTX
C++ language basic
PPTX
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
PDF
Prog1-L1.pdf
PPTX
Programming using c++ tool
PPTX
PRINCE PRESENTATION(1).pptx
PPTX
Lecture 1
PDF
C++ L01-Variables
PDF
The C++ Programming Language
C++ language basic
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
Prog1-L1.pdf
Programming using c++ tool
PRINCE PRESENTATION(1).pptx
Lecture 1
C++ L01-Variables
The C++ Programming Language

Similar to C++ programming Basic and Operators of C++ (20)

PPTX
C++ basics
PPT
Intro cpp
PPT
cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...
PDF
Tailieu.vncty.com c++ for beginners......masters 2007
PDF
C++ for beginners......masters 2007
PDF
C++ for beginners......masters 2007
PPTX
Presentation on C++ Programming Language
PDF
fundamental of c++ for students of b.tech iii rd year student
PPTX
PPTX
Intro in understanding to C programming .pptx
PPT
intro to programming languge c++ for computer department
PPTX
Module 2 | Object Oriented Programming with C++ | Basics of C++
PPT
Introduction to C++,Computer Science
PPTX
Presentation c++
PPT
programming week 2.ppt
PPTX
C++: An Introduction
PPTX
Session 1 - c++ intro
PDF
Introduction to c++
PPTX
Introduction to c++ programming language
C++ basics
Intro cpp
cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...
Tailieu.vncty.com c++ for beginners......masters 2007
C++ for beginners......masters 2007
C++ for beginners......masters 2007
Presentation on C++ Programming Language
fundamental of c++ for students of b.tech iii rd year student
Intro in understanding to C programming .pptx
intro to programming languge c++ for computer department
Module 2 | Object Oriented Programming with C++ | Basics of C++
Introduction to C++,Computer Science
Presentation c++
programming week 2.ppt
C++: An Introduction
Session 1 - c++ intro
Introduction to c++
Introduction to c++ programming language
Ad

More from VikasNirgude2 (20)

PDF
2.8 Constructor and Destructor in Derived Class.pdf
PDF
4.2 Class Template, Template and Inheritance.pdf
PDF
Function Templates,Overlaoding Function Templates.pdf
PDF
Introduction to Inheritance and Its concepts
PDF
Data Conversion and Type Casting Concepts
PDF
Operator Overloading Introduction and Concept of OV
PDF
1.11 Constructors and Destructors....pdf
PDF
1.10 Functions in C++,call by value .pdf
PDF
1.9 Class,Object,Class Scope,Accessing Class members and Controlling access t...
PDF
1.7 Arrays in C++ and its detail........pdf
PDF
1.6 Control Structures in C++ .......pdf
PDF
1.5 Data Types in C++ and Its Details.pdf
PDF
1.3 Object Oriented Programming Paradigm, Basic Concepts of Object-Oriented P...
PDF
1.2 Need of Object-Oriented Programming.pdf
PDF
1.1 Introduction to procedural, modular, object-oriented and generic programm...
PDF
B Tree, Introduction ,example,Splay tree
PPT
Tree-introduction ,Definition, Types of BT
PPTX
Double Hashing.pptx
PPTX
closed hashing.pptx
PPTX
Collision resolution.pptx
2.8 Constructor and Destructor in Derived Class.pdf
4.2 Class Template, Template and Inheritance.pdf
Function Templates,Overlaoding Function Templates.pdf
Introduction to Inheritance and Its concepts
Data Conversion and Type Casting Concepts
Operator Overloading Introduction and Concept of OV
1.11 Constructors and Destructors....pdf
1.10 Functions in C++,call by value .pdf
1.9 Class,Object,Class Scope,Accessing Class members and Controlling access t...
1.7 Arrays in C++ and its detail........pdf
1.6 Control Structures in C++ .......pdf
1.5 Data Types in C++ and Its Details.pdf
1.3 Object Oriented Programming Paradigm, Basic Concepts of Object-Oriented P...
1.2 Need of Object-Oriented Programming.pdf
1.1 Introduction to procedural, modular, object-oriented and generic programm...
B Tree, Introduction ,example,Splay tree
Tree-introduction ,Definition, Types of BT
Double Hashing.pptx
closed hashing.pptx
Collision resolution.pptx
Ad

Recently uploaded (20)

PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
Sustainable Sites - Green Building Construction
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Artificial Intelligence
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPT
Project quality management in manufacturing
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Construction Project Organization Group 2.pptx
PPTX
UNIT 4 Total Quality Management .pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Sustainable Sites - Green Building Construction
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Foundation to blockchain - A guide to Blockchain Tech
Internet of Things (IOT) - A guide to understanding
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
R24 SURVEYING LAB MANUAL for civil enggi
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
CYBER-CRIMES AND SECURITY A guide to understanding
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Artificial Intelligence
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Project quality management in manufacturing
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
OOP with Java - Java Introduction (Basics)
Construction Project Organization Group 2.pptx
UNIT 4 Total Quality Management .pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT

C++ programming Basic and Operators of C++

  • 1. Sanjivani Rural Education Society’s Sanjivani College of Engineering, Kopargaon-423 603 (An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune) NAAC ‘A’Grade Accredited, ISO 9001:2015 Certified Department of Computer Engineering (NBA Accredited) Subject- Object Oriented Programming (CO212) Unit 1 – Fundamentals of OOP Topic – 1.4 C++ Programming Basics Prof. V.N.Nirgude Assistant Professor Email: nirgudevikascomp@sanjivani.org.in Contact No: 9975240215
  • 2. What is C++? DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 2 ◼ C++ is a compiled, object-oriented language ◼ It is the “successor” to C, ◼ (the “++” is called the successor operator in C++) ◼ C was derived from a language called B which derived from BCPL was in turn ◼ C was developed in the 1970’s by Dennis Bell Labs Ritchie of AT&T ◼ C++ was developed in the early Stroustrup of AT&T Bell Labs. 1980’s by Bjarne ◼ Most of C is a subset of C++
  • 3. Simple C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 3 #include <iostream> int main() { // Declarations // Statements return 0; } ◼ Compiler directive: Tells the compiler what to do before compiling ◼ This one includes source code from another file
  • 4. Simple C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 4 #include <iostream> int main() { // Declarations // Statements return 0; } ◼ Main function
  • 5. Simple C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 5 #include <iostream> int main() { // Declarations // Statements return 0; } ◼ Header for main function ◼ States… ◼ data type for the return value ◼ identifier for function ◼ list of arguments between parenthesis (none for this function)
  • 6. Simple C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 6 #include <iostream> int main() { // Declarations // Statements return 0; } ◼ Braces enclose the body of the function ◼ They represent the start and end of the function
  • 7. Simple C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 7 #include <iostream> int main() { // Declarations // Statements return 0; } ◼ Declarations and statements ◼ Main body of function ◼ “//” represents the start of a comment
  • 8. Simple C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 8 #include <iostream> int main() { // Declarations // Statements return 0; } Return statement: ◼ specifies the value the function returns ◼ All (almost) declarations and statements end with a semi-colon “;”
  • 9. Simple C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 9 #include <iostream> int main() { // Declarations // Statements return 0; } ◼ This program doesn’t do anything!
  • 10. Sample C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 10 #include <iostream> int main() { int number; cout << “Enter a number” <<endl; cin >> number; cout << “You entered: “ <<number; return 0; } Variable declaration: ◼ The identifier number is declared as being of data type int
  • 11. Sample C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 11 #include <iostream> int main() { int number; cout << “Enter a number” <<endl; cin >> number; cout << “You entered: “ <<number; return 0; } ◼ cout: the output statement for C++ ◼ Note the direction of “<<“ ◼ endl: represents an end-of-line
  • 12. Sample C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 12 #include <iostream> int main() { int number; cout << “Enter a number” <<endl; cin >> number; cout << “You entered: “ <<number; return 0; } ◼ cin: the input statement for C++ ◼ Note the direction of “>>”
  • 13. Sample C++ Program DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 13 #include <iostream> int main() { int number; cout << “Enter a number” <<endl; cin >> number; cout << “You entered: “ <<number; return 0; } Output: Enter a number: 10 You entered:10
  • 14. Thank You.. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 14