SlideShare a Scribd company logo
Group members
1) Sarmad
2) Abubakar
3) Shohaib
4) Zunair
5) Hannan Sarfraz
C++
1. What is C++ ?
2. Its history?
3. Its working?
What is c++?
Programming language
Set of words,symbols and codes used to write programme is called programming
language
Two types of languages
(1)low level (2)high level
Low level languages
• Language near to computer hardware
• Computer can understand these languages
• Instruction are written in binary form and by using symbols
• Only programmers know these language
• Machine language(1st generation language)
• Assembly language(2nd generation language)
High level language
• Language close to human language
• Input written in english
• Easily to write and modify
• C++ is heigh level language
Compiler
• Source code
• Object code
• Coverts input written in heigh level language in to low level language
HISTORY:
• Algol language
• B language
• C language
• C++
FEATURES
• Convenient language
• Well structured language
• Speed
• Popular language
• Machine independence
Basic structure of c++
It consist of folowing parts
• Preprocessor durectives
• Main ( ) function
• Program body (c++ ststments)
#niclude<iostream>
#include<conio.h>
main()
{
Programme body
}
Preprocessor
directrives
Main function
• Lines beginning with a hash sign (#) are directives for the preprocessor.
• The #include directive tells the compiler to include some already existing
C++ code
• The directive #include <iostream> tells the preprocessor to include the
iostream standard file
• Cin and cout is define in this library
• #include <conio.h> getch and clrscr are its built in functions
• Getch()
• Clrscr
• After Main( ) the programme body starts
• Cout command is used to show results and print the statement present in “ ”.
• Cin is used to fetch the value from the user
• Endl and ‘/n’ command is used for next line
• We use semicolon ‘;’ at the end of every statement
0-10
Data Types
A data type defines a set of values and a set of operations that can be applied to
those values
• Integer: to store numerical data
• float: to store real values
• double: to store large real values
• char: to store character value
Variables
• Variables are names for memory locations.
• It is used to store input and out put results
• Each memory location in a computer has an address.
• Variable is created in Ram and are temporarily stored.
Condition making statement
• If is a key word in c++ language
• If statement is a dision making statement
• It can execute or skip a statement by checking a condition
Syntax
If(condition)
{
Statement
};
if-else statement
• Type of if statement
• Execute one block of statement when condition is true and other when it is
false
Syntax
If(condition)
{
statement
};
else
{
statement
};
Loops
Basically used for two purposes
• To execute statements for a specific number of times
• To use sequence of values
Types of loop
(1) While loop (2) do-while loop (3) for loop
While loop
While(condition)
{
Staement
Increment/decrement
};
do-while loop
syntax
do
{
Statement
Increment/decrement
}
While(condition)
Difference between while and do-while
• In while loop condition come 1st and then statements
• In do-while weather the statement comes false but loop must run once
For loop
• Known as counter-controlled loop
syntax
For(initilization,condition,increment/decrement)
{
Statement
}
Working
First initilization
Condition
Increment or decrement
The End
Any questions

More Related Content

What's hot

Python programming introduction
Python programming introductionPython programming introduction
Python programming introduction
Siddique Ibrahim
 
C programming
C programmingC programming
C programming
KarthicaMarasamy
 
Difference between c, c++ and java
Difference between c, c++ and javaDifference between c, c++ and java
Difference between c, c++ and java
Mohanasundaram Nattudurai
 
C Course Material0209
C Course Material0209C Course Material0209
C Course Material0209
chameli devi group of institutions
 
Introduction to c sharp 4.0 and dynamic
Introduction to c sharp 4.0 and dynamicIntroduction to c sharp 4.0 and dynamic
Introduction to c sharp 4.0 and dynamic
Gieno Miao
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#
Sireesh K
 
New c sharp4_features_part_iv
New c sharp4_features_part_ivNew c sharp4_features_part_iv
New c sharp4_features_part_iv
Nico Ludwig
 
C programming
C programming C programming
C programming
Rohan Gajre
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
Varun Garg
 
C#unit4
C#unit4C#unit4
C#unit4
raksharao
 
Advanced c programming in Linux
Advanced c programming in Linux Advanced c programming in Linux
Advanced c programming in Linux
Mohammad Golyani
 
Basics1
Basics1Basics1
Basics1
phanleson
 
Csc240 -lecture_3
Csc240  -lecture_3Csc240  -lecture_3
Csc240 -lecture_3
Ainuddin Yousufzai
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
MOHAMAD NOH AHMAD
 
C language introduction
C language introduction C language introduction
C language introduction
musrath mohammad
 
DLR MCQs
DLR MCQsDLR MCQs
DLR MCQs
Ghufran Shahid
 
cpp-2013 #13 C++11
cpp-2013 #13 C++11cpp-2013 #13 C++11
cpp-2013 #13 C++11
Amazon Web Services
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
nicky_walters
 
Compilers Design
Compilers DesignCompilers Design
Compilers Design
Akshaya Arunan
 
LLVM Compiler - Link Time Optimization
LLVM Compiler - Link Time OptimizationLLVM Compiler - Link Time Optimization
LLVM Compiler - Link Time Optimization
Vivek Pansara
 

What's hot (20)

Python programming introduction
Python programming introductionPython programming introduction
Python programming introduction
 
C programming
C programmingC programming
C programming
 
Difference between c, c++ and java
Difference between c, c++ and javaDifference between c, c++ and java
Difference between c, c++ and java
 
C Course Material0209
C Course Material0209C Course Material0209
C Course Material0209
 
Introduction to c sharp 4.0 and dynamic
Introduction to c sharp 4.0 and dynamicIntroduction to c sharp 4.0 and dynamic
Introduction to c sharp 4.0 and dynamic
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#
 
New c sharp4_features_part_iv
New c sharp4_features_part_ivNew c sharp4_features_part_iv
New c sharp4_features_part_iv
 
C programming
C programming C programming
C programming
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
C#unit4
C#unit4C#unit4
C#unit4
 
Advanced c programming in Linux
Advanced c programming in Linux Advanced c programming in Linux
Advanced c programming in Linux
 
Basics1
Basics1Basics1
Basics1
 
Csc240 -lecture_3
Csc240  -lecture_3Csc240  -lecture_3
Csc240 -lecture_3
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C language introduction
C language introduction C language introduction
C language introduction
 
DLR MCQs
DLR MCQsDLR MCQs
DLR MCQs
 
cpp-2013 #13 C++11
cpp-2013 #13 C++11cpp-2013 #13 C++11
cpp-2013 #13 C++11
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
 
Compilers Design
Compilers DesignCompilers Design
Compilers Design
 
LLVM Compiler - Link Time Optimization
LLVM Compiler - Link Time OptimizationLLVM Compiler - Link Time Optimization
LLVM Compiler - Link Time Optimization
 

Similar to C++

C programmimng basic.ppt
C programmimng basic.pptC programmimng basic.ppt
C programmimng basic.ppt
ASIT Education
 
c++
 c++  c++
Unit ii
Unit   iiUnit   ii
Unit ii
sathisaran
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Mahfuzur Rahman
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++
farooq2016
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
KalighatOkira
 
C for Engineers
C for EngineersC for Engineers
C for Engineers
Julie Iskander
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
Kathmandu University
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C language unit-1
C language unit-1C language unit-1
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
 
SPC Unit 2
SPC Unit 2SPC Unit 2
SPC Unit 2
SIMONTHOMAS S
 
Introduction of c programming unit-ii ppt
Introduction of  c programming unit-ii pptIntroduction of  c programming unit-ii ppt
Introduction of c programming unit-ii ppt
JStalinAsstProfessor
 
Basics Of C Programming For Beginners In Easiest Way
Basics Of C Programming For Beginners In Easiest WayBasics Of C Programming For Beginners In Easiest Way
Basics Of C Programming For Beginners In Easiest Way
akshay rajpure
 
Basic C Programming language
Basic C Programming languageBasic C Programming language
Basic C Programming language
Abhishek Soni
 
Notes of programming
Notes of programmingNotes of programming
Notes of programming
Bilal Maqbool ツ
 
Msc prev completed
Msc prev completedMsc prev completed
Msc prev completed
mshoaib15
 
Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updated
mshoaib15
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
GOKULKANNANMMECLECTC
 
C.pdf
C.pdfC.pdf

Similar to C++ (20)

C programmimng basic.ppt
C programmimng basic.pptC programmimng basic.ppt
C programmimng basic.ppt
 
c++
 c++  c++
c++
 
Unit ii
Unit   iiUnit   ii
Unit ii
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
 
C for Engineers
C for EngineersC for Engineers
C for Engineers
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
C language unit-1
C language unit-1C language unit-1
C language unit-1
 
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
 
SPC Unit 2
SPC Unit 2SPC Unit 2
SPC Unit 2
 
Introduction of c programming unit-ii ppt
Introduction of  c programming unit-ii pptIntroduction of  c programming unit-ii ppt
Introduction of c programming unit-ii ppt
 
Basics Of C Programming For Beginners In Easiest Way
Basics Of C Programming For Beginners In Easiest WayBasics Of C Programming For Beginners In Easiest Way
Basics Of C Programming For Beginners In Easiest Way
 
Basic C Programming language
Basic C Programming languageBasic C Programming language
Basic C Programming language
 
Notes of programming
Notes of programmingNotes of programming
Notes of programming
 
Msc prev completed
Msc prev completedMsc prev completed
Msc prev completed
 
Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updated
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
 
C.pdf
C.pdfC.pdf
C.pdf
 

Recently uploaded

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 

Recently uploaded (20)

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 

C++

  • 1.
  • 2. Group members 1) Sarmad 2) Abubakar 3) Shohaib 4) Zunair 5) Hannan Sarfraz
  • 3. C++
  • 4. 1. What is C++ ? 2. Its history? 3. Its working?
  • 5. What is c++? Programming language Set of words,symbols and codes used to write programme is called programming language Two types of languages (1)low level (2)high level Low level languages • Language near to computer hardware • Computer can understand these languages • Instruction are written in binary form and by using symbols • Only programmers know these language • Machine language(1st generation language) • Assembly language(2nd generation language)
  • 6. High level language • Language close to human language • Input written in english • Easily to write and modify • C++ is heigh level language Compiler • Source code • Object code • Coverts input written in heigh level language in to low level language
  • 7. HISTORY: • Algol language • B language • C language • C++ FEATURES • Convenient language • Well structured language • Speed • Popular language • Machine independence
  • 8. Basic structure of c++ It consist of folowing parts • Preprocessor durectives • Main ( ) function • Program body (c++ ststments) #niclude<iostream> #include<conio.h> main() { Programme body } Preprocessor directrives Main function
  • 9. • Lines beginning with a hash sign (#) are directives for the preprocessor. • The #include directive tells the compiler to include some already existing C++ code • The directive #include <iostream> tells the preprocessor to include the iostream standard file • Cin and cout is define in this library • #include <conio.h> getch and clrscr are its built in functions • Getch() • Clrscr • After Main( ) the programme body starts • Cout command is used to show results and print the statement present in “ ”. • Cin is used to fetch the value from the user • Endl and ‘/n’ command is used for next line • We use semicolon ‘;’ at the end of every statement
  • 10. 0-10 Data Types A data type defines a set of values and a set of operations that can be applied to those values • Integer: to store numerical data • float: to store real values • double: to store large real values • char: to store character value
  • 11. Variables • Variables are names for memory locations. • It is used to store input and out put results • Each memory location in a computer has an address. • Variable is created in Ram and are temporarily stored.
  • 12. Condition making statement • If is a key word in c++ language • If statement is a dision making statement • It can execute or skip a statement by checking a condition Syntax If(condition) { Statement };
  • 13. if-else statement • Type of if statement • Execute one block of statement when condition is true and other when it is false Syntax If(condition) { statement }; else { statement };
  • 14. Loops Basically used for two purposes • To execute statements for a specific number of times • To use sequence of values Types of loop (1) While loop (2) do-while loop (3) for loop While loop While(condition) { Staement Increment/decrement };
  • 15. do-while loop syntax do { Statement Increment/decrement } While(condition) Difference between while and do-while • In while loop condition come 1st and then statements • In do-while weather the statement comes false but loop must run once
  • 16. For loop • Known as counter-controlled loop syntax For(initilization,condition,increment/decrement) { Statement } Working First initilization Condition Increment or decrement