SlideShare a Scribd company logo
1
1
Khawaja Sharif Sediqi
Basics of C++
Programming Language
C++
• C++ is a general-purpose programing
language.
• C++ is used to create computer programs
Anything from application , Music players and
even video gamest.
3
i C++ was derived from C, and is largely based on it
C++ is a:
General purpose programing language
Movie making program
Client-side scripting language
4
C++ is a:
General purpose programing language
Movie making program
Client-side scripting language
5
main
Source code
1. // my first program in C++
2. # include <iostream>
3.
4. int main ()
5. {
6. std::cout<<“Hello Word!”;
7. }
Output
Hello Word!
6
Program execution begin with the main function ,Int main().
main
• Curly brackets { } indicate the beginning and
end of function, which can also be called the
function’s body.
• The information inside the brackets indicates
what the function does when executed.
7
i
The entry point of every C++ program is main(),
irrespective of what the program does.
What is the starting point for a computer program?
main function
from <iostream>
first line
8
What is the starting point for a computer program?
main function
from <iostream>
first line
9
Your first C++ program
1. # include <iostream>
2.
3. int main ()
4. {
5. std::cout<<“Hello Word!”;
6. }
Hello Word!
10
The next line, Cout<<“Hello world !”; result in the display of “hello world “
to the screen.
Your first C++ program
• In C++ Stream are used to perform input and out put operations.
• In the most program environments, the standard default output
destination is the screen .
• in C++ cout is the stream object used to access it.
• Cout is used in combination with the insertion operator
• Writ the insertion operator as << to insert the data that comes after it
into the stream that comes before.
11
i
In C++ , the semicolon is used to terminate a statement.
Each statement must end with a semicolon . It indicate the
end of one logical expression.
Each instruction must end with a
dot ( . )
Comma ( , )
Colon ( : )
Semicolon ( ; )
12
Each instruction must end with a
dot ( . )
Comma ( , )
Colon ( : )
Semicolon ( ; )
13
Statement
• A block is a set of logical connected
statements, surrounded by opening and closing
curly braces
1. {
2. cout<<“Hello Word!”;
return 0;
3. }
14
i
You can have multiple statement on a single line, as long as
you remember to end each statement with a semicolon .
Failing to do so will result in an error
Components of a C++ program
You can add multiple insertion operation after
cout
1. {
2. cout<<“This” << “awesome!”;
return 0;
3. }
15
New Line
The cout operator does not insert a line break at
the end of the output.
Own a way to print two line is to use the endl
manipulator , which will put a line break
1. {
2. cout<<“Hello” << endl ;
3.cout<< “My name is Ahmad!”;
return 0;
4. } 16
What should be used to move to an new line
start
#include
endl
next line
17
New Lines
The new line character n can be used as an
alternative to endl.
The backslash () is called an escape character
and indicate a “special” character.
1. {
2. cout<<“welcome n” ;
3.cout<< “My name is Ahmad!”;
return 0;
4. } 18
What is symbol for moving to a new line( alternative
to the endl)
a
n
b
19
What is symbol for moving to a new line( alternative
to the endl)
a
n
b
20
Comments
Comments are explanatory statement that you
can include in the C++ code to explain what the
code is doing.
The compiler ignores everything that appears int
the comment.so none of that information shows in
the result.
A comment beginning with two slashes (//) is
called single-line comment.
The slashes tell the compiler to ignore everything
that follows.
until the end of the line
21
Comment
1. # include <iostream>
2. using namespace std;
3. //std is declaration region
4. int main ()
5. {
6. //pring “hello world”
7. cout<<“Hello Word!”;
8. return 0;
9. }
Hello Word!
22
When the following code is compiled , it will ignore the
// prints “ hello world” statement and will produce the following result.
Which choice indicate a signal-line comment
// single line comment
** single line comment
##single the comment
23
Which choice indicate a signal-line comment
// single line comment
** single line comment
##single the comment
24
Multi-Line Comments
Comment that require multiple lines begin with
/* and end with */
You can place them on the same line or insert
one or more lines between them.
/* This is a comment */
/* C++ comments can
Span multiple lines
*/
25
Create a block comment ( multiline comment) in C+
+
This is a block /multiline
Comment in C++
26
Create a block comment ( multiline comment) in C+
+
This is a block /multiline
Comment in C++
27
/*
*/
Which of the following in true
Comments are ignored by the compiler
Comments are used to confuse programmers
single line comments starts with an *
28
Which of the following in true
Comments are ignored by the compiler
Comments are used to confuse programmers
single line comments starts with an *
29
Ad

More Related Content

What's hot (20)

basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteaching
eteaching
 
Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1
Ali Aminian
 
C++
C++C++
C++
Shyam Khant
 
c++
 c++  c++
c++
SindhuVelmukull
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
Steve Johnson
 
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
Praveen M Jigajinni
 
Basic concept of c++
Basic concept of c++Basic concept of c++
Basic concept of c++
shashikant pabari
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
TAlha MAlik
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
Keroles karam khalil
 
C++ Language
C++ LanguageC++ Language
C++ Language
Syed Zaid Irshad
 
Labsheet1stud
Labsheet1studLabsheet1stud
Labsheet1stud
rohassanie
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
Aiman Hud
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
Bussines man badhrinadh
 
C++ programming program design including data structures
C++ programming program design including data structures C++ programming program design including data structures
C++ programming program design including data structures
Ahmad Idrees
 
Managing console input
Managing console inputManaging console input
Managing console input
rajshreemuthiah
 
C Programming basics
C Programming basicsC Programming basics
C Programming basics
Jitin Pillai
 
C program
C programC program
C program
AJAL A J
 
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdfSTRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
C Tokens
C TokensC Tokens
C Tokens
Ripon Hossain
 
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteaching
eteaching
 
Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1
Ali Aminian
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
Steve Johnson
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
TAlha MAlik
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
Aiman Hud
 
C++ programming program design including data structures
C++ programming program design including data structures C++ programming program design including data structures
C++ programming program design including data structures
Ahmad Idrees
 
C Programming basics
C Programming basicsC Programming basics
C Programming basics
Jitin Pillai
 
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdfSTRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 

Similar to Beginner C++ easy slide and simple definition with questions (20)

fundamental of c++ for students of b.tech iii rd year student
fundamental of c++ for students of b.tech iii rd year studentfundamental of c++ for students of b.tech iii rd year student
fundamental of c++ for students of b.tech iii rd year student
Somesh Kumar
 
Intro to c++
Intro to c++Intro to c++
Intro to c++
Rafael Balderosa
 
C basics programming ppt by Mayanka .pdf
C basics programming  ppt  by  Mayanka .pdfC basics programming  ppt  by  Mayanka .pdf
C basics programming ppt by Mayanka .pdf
mayankamandal
 
Common Programming Errors
Common Programming ErrorsCommon Programming Errors
Common Programming Errors
Nicole Ynne Estabillo
 
C Fundamental.docx
C Fundamental.docxC Fundamental.docx
C Fundamental.docx
AbhishekGoutam6
 
Intro To C++ - Class 3 - Sample Program
Intro To C++ - Class 3 - Sample ProgramIntro To C++ - Class 3 - Sample Program
Intro To C++ - Class 3 - Sample Program
Blue Elephant Consulting
 
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part IIIntro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Blue Elephant Consulting
 
Basics Of C++.pptx
Basics Of C++.pptxBasics Of C++.pptx
Basics Of C++.pptx
DineshDhuri4
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
rohassanie
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
Mohammed Khan
 
C++
C++C++
C++
Neha Gupta
 
Chapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramChapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ Program
Deepak Singh
 
Output
OutputOutput
Output
Michael Gordon
 
C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1
Ammara Javed
 
C Programming- Harsh Sharma
C Programming- Harsh SharmaC Programming- Harsh Sharma
C Programming- Harsh Sharma
Harsh Sharma
 
Lec01-02 (Topic 1 C++ Fundamentals).pptx
Lec01-02 (Topic 1 C++ Fundamentals).pptxLec01-02 (Topic 1 C++ Fundamentals).pptx
Lec01-02 (Topic 1 C++ Fundamentals).pptx
NabilHarith2
 
C++ Introduction C+ Conditions.pptx.pptx
C++ Introduction C+ Conditions.pptx.pptxC++ Introduction C+ Conditions.pptx.pptx
C++ Introduction C+ Conditions.pptx.pptx
MAHERMOHAMED27
 
2621008 - C++ 1
2621008 -  C++ 12621008 -  C++ 1
2621008 - C++ 1
S.Ali Sadegh Zadeh
 
1.1 programming fundamentals
1.1 programming fundamentals1.1 programming fundamentals
1.1 programming fundamentals
Jawad Khan
 
Programming Fundamentals IDE's Lec3.pptx
Programming Fundamentals IDE's Lec3.pptxProgramming Fundamentals IDE's Lec3.pptx
Programming Fundamentals IDE's Lec3.pptx
hafsanadeem31
 
fundamental of c++ for students of b.tech iii rd year student
fundamental of c++ for students of b.tech iii rd year studentfundamental of c++ for students of b.tech iii rd year student
fundamental of c++ for students of b.tech iii rd year student
Somesh Kumar
 
C basics programming ppt by Mayanka .pdf
C basics programming  ppt  by  Mayanka .pdfC basics programming  ppt  by  Mayanka .pdf
C basics programming ppt by Mayanka .pdf
mayankamandal
 
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part IIIntro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Blue Elephant Consulting
 
Basics Of C++.pptx
Basics Of C++.pptxBasics Of C++.pptx
Basics Of C++.pptx
DineshDhuri4
 
Chapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramChapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ Program
Deepak Singh
 
C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1
Ammara Javed
 
C Programming- Harsh Sharma
C Programming- Harsh SharmaC Programming- Harsh Sharma
C Programming- Harsh Sharma
Harsh Sharma
 
Lec01-02 (Topic 1 C++ Fundamentals).pptx
Lec01-02 (Topic 1 C++ Fundamentals).pptxLec01-02 (Topic 1 C++ Fundamentals).pptx
Lec01-02 (Topic 1 C++ Fundamentals).pptx
NabilHarith2
 
C++ Introduction C+ Conditions.pptx.pptx
C++ Introduction C+ Conditions.pptx.pptxC++ Introduction C+ Conditions.pptx.pptx
C++ Introduction C+ Conditions.pptx.pptx
MAHERMOHAMED27
 
1.1 programming fundamentals
1.1 programming fundamentals1.1 programming fundamentals
1.1 programming fundamentals
Jawad Khan
 
Programming Fundamentals IDE's Lec3.pptx
Programming Fundamentals IDE's Lec3.pptxProgramming Fundamentals IDE's Lec3.pptx
Programming Fundamentals IDE's Lec3.pptx
hafsanadeem31
 
Ad

Recently uploaded (20)

TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Ad

Beginner C++ easy slide and simple definition with questions

  • 1. 1 1
  • 2. Khawaja Sharif Sediqi Basics of C++ Programming Language
  • 3. C++ • C++ is a general-purpose programing language. • C++ is used to create computer programs Anything from application , Music players and even video gamest. 3 i C++ was derived from C, and is largely based on it
  • 4. C++ is a: General purpose programing language Movie making program Client-side scripting language 4
  • 5. C++ is a: General purpose programing language Movie making program Client-side scripting language 5
  • 6. main Source code 1. // my first program in C++ 2. # include <iostream> 3. 4. int main () 5. { 6. std::cout<<“Hello Word!”; 7. } Output Hello Word! 6 Program execution begin with the main function ,Int main().
  • 7. main • Curly brackets { } indicate the beginning and end of function, which can also be called the function’s body. • The information inside the brackets indicates what the function does when executed. 7 i The entry point of every C++ program is main(), irrespective of what the program does.
  • 8. What is the starting point for a computer program? main function from <iostream> first line 8
  • 9. What is the starting point for a computer program? main function from <iostream> first line 9
  • 10. Your first C++ program 1. # include <iostream> 2. 3. int main () 4. { 5. std::cout<<“Hello Word!”; 6. } Hello Word! 10 The next line, Cout<<“Hello world !”; result in the display of “hello world “ to the screen.
  • 11. Your first C++ program • In C++ Stream are used to perform input and out put operations. • In the most program environments, the standard default output destination is the screen . • in C++ cout is the stream object used to access it. • Cout is used in combination with the insertion operator • Writ the insertion operator as << to insert the data that comes after it into the stream that comes before. 11 i In C++ , the semicolon is used to terminate a statement. Each statement must end with a semicolon . It indicate the end of one logical expression.
  • 12. Each instruction must end with a dot ( . ) Comma ( , ) Colon ( : ) Semicolon ( ; ) 12
  • 13. Each instruction must end with a dot ( . ) Comma ( , ) Colon ( : ) Semicolon ( ; ) 13
  • 14. Statement • A block is a set of logical connected statements, surrounded by opening and closing curly braces 1. { 2. cout<<“Hello Word!”; return 0; 3. } 14 i You can have multiple statement on a single line, as long as you remember to end each statement with a semicolon . Failing to do so will result in an error
  • 15. Components of a C++ program You can add multiple insertion operation after cout 1. { 2. cout<<“This” << “awesome!”; return 0; 3. } 15
  • 16. New Line The cout operator does not insert a line break at the end of the output. Own a way to print two line is to use the endl manipulator , which will put a line break 1. { 2. cout<<“Hello” << endl ; 3.cout<< “My name is Ahmad!”; return 0; 4. } 16
  • 17. What should be used to move to an new line start #include endl next line 17
  • 18. New Lines The new line character n can be used as an alternative to endl. The backslash () is called an escape character and indicate a “special” character. 1. { 2. cout<<“welcome n” ; 3.cout<< “My name is Ahmad!”; return 0; 4. } 18
  • 19. What is symbol for moving to a new line( alternative to the endl) a n b 19
  • 20. What is symbol for moving to a new line( alternative to the endl) a n b 20
  • 21. Comments Comments are explanatory statement that you can include in the C++ code to explain what the code is doing. The compiler ignores everything that appears int the comment.so none of that information shows in the result. A comment beginning with two slashes (//) is called single-line comment. The slashes tell the compiler to ignore everything that follows. until the end of the line 21
  • 22. Comment 1. # include <iostream> 2. using namespace std; 3. //std is declaration region 4. int main () 5. { 6. //pring “hello world” 7. cout<<“Hello Word!”; 8. return 0; 9. } Hello Word! 22 When the following code is compiled , it will ignore the // prints “ hello world” statement and will produce the following result.
  • 23. Which choice indicate a signal-line comment // single line comment ** single line comment ##single the comment 23
  • 24. Which choice indicate a signal-line comment // single line comment ** single line comment ##single the comment 24
  • 25. Multi-Line Comments Comment that require multiple lines begin with /* and end with */ You can place them on the same line or insert one or more lines between them. /* This is a comment */ /* C++ comments can Span multiple lines */ 25
  • 26. Create a block comment ( multiline comment) in C+ + This is a block /multiline Comment in C++ 26
  • 27. Create a block comment ( multiline comment) in C+ + This is a block /multiline Comment in C++ 27 /* */
  • 28. Which of the following in true Comments are ignored by the compiler Comments are used to confuse programmers single line comments starts with an * 28
  • 29. Which of the following in true Comments are ignored by the compiler Comments are used to confuse programmers single line comments starts with an * 29