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

More Related Content

What's hot

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++
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++ overviewTAlha 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
 
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
 
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
 

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
 
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
 
C++
C++C++
C++
 
c++
 c++  c++
c++
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
 
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
 
Basic concept of c++
Basic concept of c++Basic concept of c++
Basic concept of c++
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Labsheet1stud
Labsheet1studLabsheet1stud
Labsheet1stud
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
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
 
Managing console input
Managing console inputManaging console input
Managing console input
 
C Programming basics
C Programming basicsC Programming basics
C Programming basics
 
C program
C programC program
C program
 
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
 
C Tokens
C TokensC Tokens
C Tokens
 
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
 

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

Intro to c++
Intro to c++Intro to c++
Intro to c++
Rafael Balderosa
 
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
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
Mohammed Khan
 
C++
C++C++
Chapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramChapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramDeepak 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
 
1.1 programming fundamentals
1.1 programming fundamentals1.1 programming fundamentals
1.1 programming fundamentals
Jawad Khan
 
Ch2 C Fundamentals
Ch2 C FundamentalsCh2 C Fundamentals
Ch2 C Fundamentals
SzeChingChen
 
Lecture 1.3 A Simple Program to Print a Line of Text.pdf
Lecture 1.3 A Simple Program to Print a Line of Text.pdfLecture 1.3 A Simple Program to Print a Line of Text.pdf
Lecture 1.3 A Simple Program to Print a Line of Text.pdf
MianSaeedAkbar1
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++
Marco Izzotti
 
Introduction to C++,Computer Science
Introduction to C++,Computer ScienceIntroduction to C++,Computer Science
Introduction to C++,Computer Science
Abhinav Vishnoi
 
Intro cpp
Intro cppIntro cpp
Intro cpp
hamza239523
 

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

Intro to c++
Intro to c++Intro to c++
Intro to c++
 
Common Programming Errors
Common Programming ErrorsCommon Programming Errors
Common Programming Errors
 
C Fundamental.docx
C Fundamental.docxC Fundamental.docx
C Fundamental.docx
 
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
 
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
 
Basics Of C++.pptx
Basics Of C++.pptxBasics Of C++.pptx
Basics Of C++.pptx
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
C++
C++C++
C++
 
Chapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ ProgramChapter 2 - Structure of C++ Program
Chapter 2 - Structure of C++ Program
 
Output
OutputOutput
Output
 
C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1
 
C Programming- Harsh Sharma
C Programming- Harsh SharmaC Programming- Harsh Sharma
C Programming- Harsh Sharma
 
2621008 - C++ 1
2621008 -  C++ 12621008 -  C++ 1
2621008 - C++ 1
 
1.1 programming fundamentals
1.1 programming fundamentals1.1 programming fundamentals
1.1 programming fundamentals
 
Ch2 C Fundamentals
Ch2 C FundamentalsCh2 C Fundamentals
Ch2 C Fundamentals
 
Lecture 1.3 A Simple Program to Print a Line of Text.pdf
Lecture 1.3 A Simple Program to Print a Line of Text.pdfLecture 1.3 A Simple Program to Print a Line of Text.pdf
Lecture 1.3 A Simple Program to Print a Line of Text.pdf
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++
 
Introduction to C++,Computer Science
Introduction to C++,Computer ScienceIntroduction to C++,Computer Science
Introduction to C++,Computer Science
 
Intro cpp
Intro cppIntro cpp
Intro cpp
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 

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