SlideShare a Scribd company logo
1 of 15
INTRODUCTION TO C++
What is C++?
• C++ was developed by Bjarne Stroustrup, as an extension to the C
language.
• C++ is a cross-platform language that can be used to create high-
performance applications.
• C++ gives programmers a high level of control over system resources
and memory.
Uses of C++ language
• To design operating system.
• To develop games.
• Design web browser.
• To develop of new language.
C++ data types
Primary data type int, float, char, void
User defined data type
structure, union, class,
enumeration
Derived data type
array, function, pointer,
reference
Keywords in C++
asm default For private struct unsigned
auto delete Friend protected switch using
bool do Goto public template virtual
break double If register this void
case dynamic_cast inline reinterpret_cast throw volatile
catch else int return true wchar_t
char enum long short try while
class explicit mutable signed typedef
const extern namespace sizeof typeid
const_cast false new static typename
continue float operator static_cast union
Tips in writing a program
• The machine problem must be analyzed through identification of
the requirement.
• Interpret the machine problem through Pseudocode algorithm and
flowchart symbols.
• Observe the technical writing structure in writing a program.
• The output of the program must achieve a user-friendly interface.
Sample
#include <iostream>
using namespace std;
int main()
{
//display message
cout<<"Welcome to C++ Programming!n";
return 0;
}
1
2
3
4
5
6
7
8
9
10
Welcome to C++ Programming!
Sample OutputSource Code
Line 1:
#include <iostream>
This is a directive that instructs the preprocessor to include a section
of standard C++ code, known as header iostream that allows to
perform standard input and output operations.
Line 2:
using namespace std;
This code instructs the C++ compiler to use the standard C++
library. The identifier cout and cin are part of the standard library.
Line 4:
int main()
This line initiates the declaration of a function. The function
named main is a special function that is called when the
program is run. The execution of all C++ programs begins with
the main function, regardless of where the function is actually
located within the code.
Line 6:
//display message
This is a comment line. Comments do not have any effect on the
behavior of the program. Programmers can use them to create short
explanation or description of the codes.
Line 7:
cout << “Welcome to C++ Programming!n”;
cout represents the standard output stream in C++. The
meaning of the statement above is to insert a series of characters
(in this case the Welcome to C++ Programming! characters)
into the screen.
Line 7:
n
In printing the output, notice that it has n. This special character is
an escape sequence or escape character. Escape characters are
preceded by a backslash (). n indicates a new line. Some of the
escape characters are t which indicates a horizontal tab,  which is
used to print out a backslash () and ” which is used to print out a
double quote.
Line 8:
return 0;
The return statement causes the main function to finish. Return may be
followed by a return code (in our example is followed by the return
code 0). A return code of 0 for the main function is generally
interpreted as the program worked as expected without any errors
during its execution. This is the most usual way to end a C++ console
program.
Thank You!

More Related Content

What's hot (20)

C Token’s
C Token’sC Token’s
C Token’s
 
C programming language
C programming languageC programming language
C programming language
 
Hands-on Introduction to the C Programming Language
Hands-on Introduction to the C Programming LanguageHands-on Introduction to the C Programming Language
Hands-on Introduction to the C Programming Language
 
Assignment7
Assignment7Assignment7
Assignment7
 
Assignment12
Assignment12Assignment12
Assignment12
 
C tokens
C tokensC tokens
C tokens
 
C Programming
C ProgrammingC Programming
C Programming
 
Cnotes
CnotesCnotes
Cnotes
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
CP Handout#10
CP Handout#10CP Handout#10
CP Handout#10
 
Beginner C++ easy slide and simple definition with questions
Beginner C++ easy slide and simple definition with questions Beginner C++ easy slide and simple definition with questions
Beginner C++ easy slide and simple definition with questions
 
pyton Notes1
pyton Notes1pyton Notes1
pyton Notes1
 
C++ lecture 01
C++   lecture 01C++   lecture 01
C++ lecture 01
 
Advanced C Language for Engineering
Advanced C Language for EngineeringAdvanced C Language for Engineering
Advanced C Language for Engineering
 
C++ Tutorial
C++ TutorialC++ Tutorial
C++ Tutorial
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
C introduction
C introductionC introduction
C introduction
 
Lecture 21 22
Lecture 21 22Lecture 21 22
Lecture 21 22
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 

Similar to AS TASKS #8

Similar to AS TASKS #8 (20)

C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
Basic c
Basic cBasic c
Basic c
 
Programming in C - interview questions.pdf
Programming in C - interview questions.pdfProgramming in C - interview questions.pdf
Programming in C - interview questions.pdf
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
C++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWAREC++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWARE
 
C language tutorial
C language tutorialC language tutorial
C language tutorial
 
keyword
keywordkeyword
keyword
 
keyword
keywordkeyword
keyword
 
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYC LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
 
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0x
 
What is turbo c and how it works
What is turbo c and how it worksWhat is turbo c and how it works
What is turbo c and how it works
 
C language
C language C language
C language
 
Unit 1 c - all topics
Unit 1   c - all topicsUnit 1   c - all topics
Unit 1 c - all topics
 
L03vars
L03varsL03vars
L03vars
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
C tutorials
C tutorialsC tutorials
C tutorials
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
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
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
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
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 

AS TASKS #8

  • 2. What is C++? • C++ was developed by Bjarne Stroustrup, as an extension to the C language. • C++ is a cross-platform language that can be used to create high- performance applications. • C++ gives programmers a high level of control over system resources and memory.
  • 3. Uses of C++ language • To design operating system. • To develop games. • Design web browser. • To develop of new language.
  • 4. C++ data types Primary data type int, float, char, void User defined data type structure, union, class, enumeration Derived data type array, function, pointer, reference
  • 5. Keywords in C++ asm default For private struct unsigned auto delete Friend protected switch using bool do Goto public template virtual break double If register this void case dynamic_cast inline reinterpret_cast throw volatile catch else int return true wchar_t char enum long short try while class explicit mutable signed typedef const extern namespace sizeof typeid const_cast false new static typename continue float operator static_cast union
  • 6. Tips in writing a program • The machine problem must be analyzed through identification of the requirement. • Interpret the machine problem through Pseudocode algorithm and flowchart symbols. • Observe the technical writing structure in writing a program. • The output of the program must achieve a user-friendly interface.
  • 7. Sample #include <iostream> using namespace std; int main() { //display message cout<<"Welcome to C++ Programming!n"; return 0; } 1 2 3 4 5 6 7 8 9 10 Welcome to C++ Programming! Sample OutputSource Code
  • 8. Line 1: #include <iostream> This is a directive that instructs the preprocessor to include a section of standard C++ code, known as header iostream that allows to perform standard input and output operations.
  • 9. Line 2: using namespace std; This code instructs the C++ compiler to use the standard C++ library. The identifier cout and cin are part of the standard library.
  • 10. Line 4: int main() This line initiates the declaration of a function. The function named main is a special function that is called when the program is run. The execution of all C++ programs begins with the main function, regardless of where the function is actually located within the code.
  • 11. Line 6: //display message This is a comment line. Comments do not have any effect on the behavior of the program. Programmers can use them to create short explanation or description of the codes.
  • 12. Line 7: cout << “Welcome to C++ Programming!n”; cout represents the standard output stream in C++. The meaning of the statement above is to insert a series of characters (in this case the Welcome to C++ Programming! characters) into the screen.
  • 13. Line 7: n In printing the output, notice that it has n. This special character is an escape sequence or escape character. Escape characters are preceded by a backslash (). n indicates a new line. Some of the escape characters are t which indicates a horizontal tab, which is used to print out a backslash () and ” which is used to print out a double quote.
  • 14. Line 8: return 0; The return statement causes the main function to finish. Return may be followed by a return code (in our example is followed by the return code 0). A return code of 0 for the main function is generally interpreted as the program worked as expected without any errors during its execution. This is the most usual way to end a C++ console program.