SlideShare a Scribd company logo
1 of 18
C++ Language 
By:-AAKASH KAUSHIK 
#9289817971, 98919893083 
Email-theaakashkumar@gmail.com
UNIT -2 
BASIC STRUCTURE OF 
A C++ PROGRAM
BASIC STRUCTURE OF A C++ 
PROGRAM 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
Program code will be written here 
getch(); 
} 
AAKASH KAUSHIK 
9891983083,9289817971
#include<iostream.h> 
# 
# is called Preprocessor directive 
Preprocessing 
Preprocessing is the phase of compilation before 
the actual execution. 
AAKASH KAUSHIK 
9891983083,9289817971
#include<iostream.h> 
#include<conio.h> 
These are the header file inclusion statement 
Header Files 
Header files are the predefined files in the C++ 
library using which we create new program. 
AAKASH KAUSHIK 
9891983083,9289817971
void main() 
This is the main() method/ function of a C++ 
program. Actual execution of a program starts 
from main method. 
AAKASH KAUSHIK 
9891983083,9289817971
FIRST C++ PROGRAM 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
cout<<“My First C++ Program”; 
getch(); 
} 
TO COMPILE- Alt+F9 
TO EXECUTE-Ctrl+F9 
AAKASH KAUSHIK 
9891983083,9289817971
iostream.h 
Iostream stands for Input Output Stream 
It contains functions related to input and output. 
For ex.- cout,cin etc. 
AAKASH KAUSHIK 
9891983083,9289817971
conio.h 
conio stands for Console Input Output . 
It contains functions related to Console screen 
input and output. 
The output screen of C++ is called Console 
Screen. 
AAKASH KAUSHIK 
9891983083,9289817971
clrscr(); 
Function defined within conio.h file 
It clears the previous output screen. 
AAKASH KAUSHIK 
9891983083,9289817971
cout<<“ text to be display”; 
Defined within iostream.h 
The text written within double quotes(“ ”) will got 
displayed on the output screen as it is. 
AAKASH KAUSHIK 
9891983083,9289817971
getch(); 
Function defined within conio.h file 
It holds the final output screen until any 
key is pressed by user. 
AAKASH KAUSHIK 
9891983083,9289817971
RULES OF C++ LANGUAGE 
 Every program should have main() 
 Every statement should be end with 
semicolon(;) 
 This Language is case sensitive 
 All the letter should be in lowercase. 
AAKASH KAUSHIK 
9891983083,9289817971
Escape sequences 
n – New Line 
t - Horizontal Tab 
a - beep 
// - / 
/’ - ’ 
/” - ” 
0 –Null 
AAKASH KAUSHIK 
9891983083,9289817971
Comments in a C++ Program 
Comments are used to increase 
understandability and readability of a 
program. These comments will be ignored by 
the compiler at the time of 
compilation/execution. 
i.e, comments are part of a program but not 
the part of compiled/executed code. 
AAKASH KAUSHIK 
9891983083,9289817971
Type of Comments 
SINGLE LINE COMMENT 
Starts with // and treats all the contents 
following // as comments within that line 
MULTIPLE LINE COMMENT 
Starts with /* and ends with */ and all the 
contents in between will be treated as 
comments 
AAKASH KAUSHIK 
9891983083,9289817971
COMMENTS USAGE EXAMPLE 
/* TITLE :- MY FIRST C++ PROGRAM 
CREATED BY :- XYZ 
*/ 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); // to clear the output screen 
cout<<“My First C++ Program”; 
getch(); //to pause the final output 
} 
AAKASH KAUSHIK 
9891983083,9289817971
THANK 
YOU 
AAKASH KAUSHIK 
9891983083,9289817971

More Related Content

What's hot (20)

Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
Inline Functions and Default arguments
Inline Functions and Default argumentsInline Functions and Default arguments
Inline Functions and Default arguments
 
Loops c++
Loops c++Loops c++
Loops c++
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 
Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c language
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Inline function
Inline functionInline function
Inline function
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Function in C program
Function in C programFunction in C program
Function in C program
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Storage class
Storage classStorage class
Storage class
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
[OOP - Lec 18] Static Data Member
[OOP - Lec 18] Static Data Member[OOP - Lec 18] Static Data Member
[OOP - Lec 18] Static Data Member
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
 
C++ decision making
C++ decision makingC++ decision making
C++ decision making
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Constructors and Destructor in C++
Constructors and Destructor in C++Constructors and Destructor in C++
Constructors and Destructor in C++
 

Similar to c++ programming Unit 2 basic structure of a c++ program

C programming on Ubuntu
C programming on UbuntuC programming on Ubuntu
C programming on UbuntuBinu Joy
 
[ITP - Lecture 03] Introduction to C/C++
[ITP - Lecture 03] Introduction to C/C++[ITP - Lecture 03] Introduction to C/C++
[ITP - Lecture 03] Introduction to C/C++Muhammad Hammad Waseem
 
ICT1002-W8-LEC-Introduction-to-C.pdf
ICT1002-W8-LEC-Introduction-to-C.pdfICT1002-W8-LEC-Introduction-to-C.pdf
ICT1002-W8-LEC-Introduction-to-C.pdfssuser33f16f
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c languagefarishah
 
Structure of c
Structure of cStructure of c
Structure of cdevauro
 
Basic c programming and explanation PPT1
Basic c programming and explanation PPT1Basic c programming and explanation PPT1
Basic c programming and explanation PPT1Rumman Ansari
 
Ch2 C Fundamentals
Ch2 C FundamentalsCh2 C Fundamentals
Ch2 C FundamentalsSzeChingChen
 
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 itPushkarNiroula1
 
Writing first C Program
Writing first C ProgramWriting first C Program
Writing first C ProgramPriyanka Anni
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiSowmya Jyothi
 
Programming in c_in_7_days
Programming in c_in_7_daysProgramming in c_in_7_days
Programming in c_in_7_daysAnkit Dubey
 
C++ chapter # 1
C++ chapter # 1C++ chapter # 1
C++ chapter # 1AliIjaz35
 

Similar to c++ programming Unit 2 basic structure of a c++ program (20)

C++ Chapter 3
C++ Chapter 3C++ Chapter 3
C++ Chapter 3
 
C programming on Ubuntu
C programming on UbuntuC programming on Ubuntu
C programming on Ubuntu
 
[ITP - Lecture 03] Introduction to C/C++
[ITP - Lecture 03] Introduction to C/C++[ITP - Lecture 03] Introduction to C/C++
[ITP - Lecture 03] Introduction to C/C++
 
ICT1002-W8-LEC-Introduction-to-C.pdf
ICT1002-W8-LEC-Introduction-to-C.pdfICT1002-W8-LEC-Introduction-to-C.pdf
ICT1002-W8-LEC-Introduction-to-C.pdf
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
C basics
C   basicsC   basics
C basics
 
Structure of c
Structure of cStructure of c
Structure of c
 
C PROGRAMMING p-2.pdf
C PROGRAMMING p-2.pdfC PROGRAMMING p-2.pdf
C PROGRAMMING p-2.pdf
 
Beta kate
Beta kateBeta kate
Beta kate
 
CC 3 - Module 2.pdf
CC 3 - Module 2.pdfCC 3 - Module 2.pdf
CC 3 - Module 2.pdf
 
Basic c programming and explanation PPT1
Basic c programming and explanation PPT1Basic c programming and explanation PPT1
Basic c programming and explanation PPT1
 
Ch2 C Fundamentals
Ch2 C FundamentalsCh2 C Fundamentals
Ch2 C Fundamentals
 
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
 
Writing first C Program
Writing first C ProgramWriting first C Program
Writing first C Program
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
 
How c/c++ works
How c/c++ worksHow c/c++ works
How c/c++ works
 
Programming in c_in_7_days
Programming in c_in_7_daysProgramming in c_in_7_days
Programming in c_in_7_days
 
C structure
C structureC structure
C structure
 
Unit 2 l1
Unit 2 l1Unit 2 l1
Unit 2 l1
 
C++ chapter # 1
C++ chapter # 1C++ chapter # 1
C++ chapter # 1
 

More from AAKASH KUMAR

NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...AAKASH KUMAR
 
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CSAAKASH KUMAR
 
Inheritance question
Inheritance questionInheritance question
Inheritance questionAAKASH KUMAR
 
Header file BASED QUESTION- CBSE CS CLASS 12TH
Header file BASED QUESTION- CBSE CS CLASS 12THHeader file BASED QUESTION- CBSE CS CLASS 12TH
Header file BASED QUESTION- CBSE CS CLASS 12THAAKASH KUMAR
 
Constructor & destructor based question- cbse cs class 12th
Constructor & destructor based question-  cbse cs class 12thConstructor & destructor based question-  cbse cs class 12th
Constructor & destructor based question- cbse cs class 12thAAKASH KUMAR
 
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAMCHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAMAAKASH KUMAR
 
Practical exam special- CBSE CS CLASS 12th
Practical exam special- CBSE CS CLASS 12thPractical exam special- CBSE CS CLASS 12th
Practical exam special- CBSE CS CLASS 12thAAKASH KUMAR
 
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CSAAKASH KUMAR
 
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...AAKASH KUMAR
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...AAKASH KUMAR
 
Inheritance question class 12th
Inheritance question class 12thInheritance question class 12th
Inheritance question class 12thAAKASH KUMAR
 
Power point2007instruction
Power point2007instructionPower point2007instruction
Power point2007instructionAAKASH KUMAR
 
Html introduction Part-2
Html introduction Part-2Html introduction Part-2
Html introduction Part-2AAKASH KUMAR
 
Evolution / history of Computer
Evolution / history of ComputerEvolution / history of Computer
Evolution / history of ComputerAAKASH KUMAR
 
Array within a class
Array within a classArray within a class
Array within a classAAKASH KUMAR
 
Input Output Devices and Memory Unit
Input Output Devices and Memory UnitInput Output Devices and Memory Unit
Input Output Devices and Memory UnitAAKASH KUMAR
 

More from AAKASH KUMAR (20)

NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
 
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
 
Inheritance question
Inheritance questionInheritance question
Inheritance question
 
Header file BASED QUESTION- CBSE CS CLASS 12TH
Header file BASED QUESTION- CBSE CS CLASS 12THHeader file BASED QUESTION- CBSE CS CLASS 12TH
Header file BASED QUESTION- CBSE CS CLASS 12TH
 
Constructor & destructor based question- cbse cs class 12th
Constructor & destructor based question-  cbse cs class 12thConstructor & destructor based question-  cbse cs class 12th
Constructor & destructor based question- cbse cs class 12th
 
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAMCHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
 
Practical exam special- CBSE CS CLASS 12th
Practical exam special- CBSE CS CLASS 12thPractical exam special- CBSE CS CLASS 12th
Practical exam special- CBSE CS CLASS 12th
 
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
 
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
 
Inheritance question class 12th
Inheritance question class 12thInheritance question class 12th
Inheritance question class 12th
 
Ms word Part 2
Ms  word Part 2Ms  word Part 2
Ms word Part 2
 
Ms word Part 1
Ms  word Part 1Ms  word Part 1
Ms word Part 1
 
Power point2007instruction
Power point2007instructionPower point2007instruction
Power point2007instruction
 
Html introduction Part-2
Html introduction Part-2Html introduction Part-2
Html introduction Part-2
 
Html Slide Part-1
Html Slide Part-1Html Slide Part-1
Html Slide Part-1
 
Evolution / history of Computer
Evolution / history of ComputerEvolution / history of Computer
Evolution / history of Computer
 
computer system
computer system computer system
computer system
 
Array within a class
Array within a classArray within a class
Array within a class
 
Input Output Devices and Memory Unit
Input Output Devices and Memory UnitInput Output Devices and Memory Unit
Input Output Devices and Memory Unit
 

Recently uploaded

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 

Recently uploaded (20)

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 

c++ programming Unit 2 basic structure of a c++ program

  • 1. C++ Language By:-AAKASH KAUSHIK #9289817971, 98919893083 Email-theaakashkumar@gmail.com
  • 2. UNIT -2 BASIC STRUCTURE OF A C++ PROGRAM
  • 3. BASIC STRUCTURE OF A C++ PROGRAM #include<iostream.h> #include<conio.h> void main() { clrscr(); Program code will be written here getch(); } AAKASH KAUSHIK 9891983083,9289817971
  • 4. #include<iostream.h> # # is called Preprocessor directive Preprocessing Preprocessing is the phase of compilation before the actual execution. AAKASH KAUSHIK 9891983083,9289817971
  • 5. #include<iostream.h> #include<conio.h> These are the header file inclusion statement Header Files Header files are the predefined files in the C++ library using which we create new program. AAKASH KAUSHIK 9891983083,9289817971
  • 6. void main() This is the main() method/ function of a C++ program. Actual execution of a program starts from main method. AAKASH KAUSHIK 9891983083,9289817971
  • 7. FIRST C++ PROGRAM #include<iostream.h> #include<conio.h> void main() { clrscr(); cout<<“My First C++ Program”; getch(); } TO COMPILE- Alt+F9 TO EXECUTE-Ctrl+F9 AAKASH KAUSHIK 9891983083,9289817971
  • 8. iostream.h Iostream stands for Input Output Stream It contains functions related to input and output. For ex.- cout,cin etc. AAKASH KAUSHIK 9891983083,9289817971
  • 9. conio.h conio stands for Console Input Output . It contains functions related to Console screen input and output. The output screen of C++ is called Console Screen. AAKASH KAUSHIK 9891983083,9289817971
  • 10. clrscr(); Function defined within conio.h file It clears the previous output screen. AAKASH KAUSHIK 9891983083,9289817971
  • 11. cout<<“ text to be display”; Defined within iostream.h The text written within double quotes(“ ”) will got displayed on the output screen as it is. AAKASH KAUSHIK 9891983083,9289817971
  • 12. getch(); Function defined within conio.h file It holds the final output screen until any key is pressed by user. AAKASH KAUSHIK 9891983083,9289817971
  • 13. RULES OF C++ LANGUAGE  Every program should have main()  Every statement should be end with semicolon(;)  This Language is case sensitive  All the letter should be in lowercase. AAKASH KAUSHIK 9891983083,9289817971
  • 14. Escape sequences n – New Line t - Horizontal Tab a - beep // - / /’ - ’ /” - ” 0 –Null AAKASH KAUSHIK 9891983083,9289817971
  • 15. Comments in a C++ Program Comments are used to increase understandability and readability of a program. These comments will be ignored by the compiler at the time of compilation/execution. i.e, comments are part of a program but not the part of compiled/executed code. AAKASH KAUSHIK 9891983083,9289817971
  • 16. Type of Comments SINGLE LINE COMMENT Starts with // and treats all the contents following // as comments within that line MULTIPLE LINE COMMENT Starts with /* and ends with */ and all the contents in between will be treated as comments AAKASH KAUSHIK 9891983083,9289817971
  • 17. COMMENTS USAGE EXAMPLE /* TITLE :- MY FIRST C++ PROGRAM CREATED BY :- XYZ */ #include<iostream.h> #include<conio.h> void main() { clrscr(); // to clear the output screen cout<<“My First C++ Program”; getch(); //to pause the final output } AAKASH KAUSHIK 9891983083,9289817971
  • 18. THANK YOU AAKASH KAUSHIK 9891983083,9289817971