際際滷

際際滷Share a Scribd company logo
C++ PROGRAMMING
Prepared By:
Ali Ijaz
SIMPLE CODING IN C++
#include <iostream>
using namespace std;
int main ()
{
cout << My Name Is Ali ;
return 0;
}
DEFINE HEADER FILE:
This statement includes the header
file into the application so that you
are able to use the operations
included in them. Also, you can create
your own header files and include
them in your program using the
#include.
Iostream:
iostream is what
you call the header file. It is
a standard C++
input/output library file.
It comes packaged with the
compiler/IDE and contain
mechanisms to get the
information from the user
and print same or added
information to a file, screen
or any other media.
WHAT IS #INCLUDE?
THE #INCLUDE IOSTREAM FILE, INTO THE
PROGRAM. THIS ENSURES THAT NOW YOURE
ABLE TO USE THE OPERATIONS, IOSTREAM
OPERATIONS (LIKE: TAKING INPUT FROM USER,
DISPLAYING OUTPUT ON THE SCREEN), IN THE
PROGRAM.
WHAT IS USING NAMESPACE
STD;?
The statement is intuitive in itself, you are
using the namespace std in your file.
We use the namespace std to make it easier to
reference operations included in that
namespace.
If we hadnt used the namespace, wed have
written std::cout instead of cout. This tells the
compiler that every cout is actually std::cout.
Whats a namespace?
Its a region where your code resides. It limits or
expands the scope of your code to one or
more files.
Why do you use namespace?
Like two persons can have the same name,
variables and functions in C++ can have same
names as well. The use of namespace is to
avoid the confusion of which
variables/functions you are referencing to.
SEMICOLON ;
 Ask any C++ programmer and they will tell you at least one horror story related to
the semicolon ; .
 The semicolon is a terminal. It terminates a statement. When missed or incorrectly
used, it will cause a lot of issues.
INT MAIN() { }
As the name suggests, it is the main function of the program. The code inside { } is
called the body and is executed first when you run your C++ program.
It is one code that is mandatory in a C++ program. If you just have this line of code
alone, your program will be valid.
COUT << ALI;
This statement prints Ali onto the output screen.
The cout is an object of standard output stream. What this means is, it outputs/prints the
data after << , i.e: Ali into a stream (in this case, the output screen).
WHAT IS A STREAM?
STREAM IS BASICALLY A SEQUENCE
OBJECTS, USUALLY BYTES. IT CAN
DESCRIBE FILES, INPUT/OUTPUT
TERMINAL, SOCKETS, ETC.
WHAT IS <<?
<< IS THE INSERTION OPERATOR
TO WRITE FORMATTED DATA INTO THE
STREAM.
WHAT IS RETURN 0;?
THIS STATEMENT RETURNS 0 ZERO.
THIS IS CALLED A RETURN STATEMENT. IT ISNT
MANDATORY TO RETURN ANYTHING FROM THE
FUNCTION BUT IS RATHER A CONVENTION. IF NOT
RETURN, THE COMPILER RETURNS A STATUS
AUTOMATICALLY.
WHY ZERO IN RETURN STATEMENT?
IT DENOTES EXIT STATUS OF THE APPLICATION THAT
BASICALLY THE TELLS SYSTEM THE PROGRAM
FINE.
Thank You

More Related Content

What's hot (20)

PPT
Fp201 unit2 1
rohassanie
PDF
Output
Michael Gordon
PDF
Compiler design lab programs
Guru Janbheshver University, Hisar
PDF
01. introduction to C++
Haresh Jaiswal
PPTX
Inline Functions and Default arguments
Nikhil Pandit
PPTX
Compiler design lab
ilias ahmed
PDF
escape sequences and substitution markers
Micheal Ogundero
PPTX
Writing first C Program
Priyanka Anni
PPTX
Write a program that accepts percentage from the user and displays its grade ...
Farwa Aqeel
PDF
csharp repitition structures
Micheal Ogundero
PPTX
Operators
Allah Ditta
PPTX
Function overloading
Ashish Kelwa
PPTX
Functions in c++
HalaiHansaika
PPT
C introduction
Kamran
PPTX
How c program execute in c program
Rumman Ansari
DOCX
Practical no 6
Kshitija Dalvi
PPTX
My first program in c, hello world !
Rumman Ansari
PDF
Cs17 (1)
sirajsiraji
ODP
C++ Function
PingLun Liao
DOCX
#Include
Saurabh Chauhan
Fp201 unit2 1
rohassanie
Compiler design lab programs
Guru Janbheshver University, Hisar
01. introduction to C++
Haresh Jaiswal
Inline Functions and Default arguments
Nikhil Pandit
Compiler design lab
ilias ahmed
escape sequences and substitution markers
Micheal Ogundero
Writing first C Program
Priyanka Anni
Write a program that accepts percentage from the user and displays its grade ...
Farwa Aqeel
csharp repitition structures
Micheal Ogundero
Operators
Allah Ditta
Function overloading
Ashish Kelwa
Functions in c++
HalaiHansaika
C introduction
Kamran
How c program execute in c program
Rumman Ansari
Practical no 6
Kshitija Dalvi
My first program in c, hello world !
Rumman Ansari
Cs17 (1)
sirajsiraji
C++ Function
PingLun Liao
#Include
Saurabh Chauhan

Similar to C++ chapter # 1 (20)

PPTX
Introduction to cpp language and all the required information relating to it
PushkarNiroula1
PDF
fundamental of c++ for students of b.tech iii rd year student
Somesh Kumar
PDF
Bcsl 031 solve assignment
Indira Gnadhi National Open University (IGNOU)
PPTX
C++ AND CATEGORIES OF SOFTWARE
UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA
PPT
intro to programming languge c++ for computer department
MemMem25
PPTX
POLITEKNIK MALAYSIA
Aiman Hud
PPTX
Lecture 1
Mohammed Khan
PPTX
Session 1 - c++ intro
VijayaNagarajan5
PPT
Basics of C++ computer language presentation.ppt
AjayLobo1
PPT
Introduction to C++,Computer Science
Abhinav Vishnoi
PPTX
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Blue Elephant Consulting
PPTX
Intro To C++ - Class 3 - Sample Program
Blue Elephant Consulting
PDF
Chap 2 c++
Widad Jamaluddin
PPTX
lecture1 pf.pptx
MalikMFalakShairUnkn
PPTX
Programming Fundamentals IDE's Lec3.pptx
hafsanadeem31
PDF
A tutorial on C++ Programming
Prof. Erwin Globio
PPTX
C Programming- Harsh Sharma
Harsh Sharma
PDF
PROGRAMMING FUNDAMENTALS BASICS LECTURE 2
AmmarAhmad42878
PPTX
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
ANUSUYA S
PDF
Introduction to cpp
Nilesh Dalvi
Introduction to cpp language and all the required information relating to it
PushkarNiroula1
fundamental of c++ for students of b.tech iii rd year student
Somesh Kumar
C++ AND CATEGORIES OF SOFTWARE
UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA
intro to programming languge c++ for computer department
MemMem25
POLITEKNIK MALAYSIA
Aiman Hud
Lecture 1
Mohammed Khan
Session 1 - c++ intro
VijayaNagarajan5
Basics of C++ computer language presentation.ppt
AjayLobo1
Introduction to C++,Computer Science
Abhinav Vishnoi
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Blue Elephant Consulting
Intro To C++ - Class 3 - Sample Program
Blue Elephant Consulting
Chap 2 c++
Widad Jamaluddin
lecture1 pf.pptx
MalikMFalakShairUnkn
Programming Fundamentals IDE's Lec3.pptx
hafsanadeem31
A tutorial on C++ Programming
Prof. Erwin Globio
C Programming- Harsh Sharma
Harsh Sharma
PROGRAMMING FUNDAMENTALS BASICS LECTURE 2
AmmarAhmad42878
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
ANUSUYA S
Introduction to cpp
Nilesh Dalvi
Ad

Recently uploaded (20)

PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
PDF
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
DOCX
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
PPTX
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
PDF
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
PDF
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
PDF
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
PDF
Mastering VPC Architecture Build for Scale from Day 1.pdf
Devseccops.ai
PPTX
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
PDF
OpenChain Webinar - AboutCode - Practical Compliance in One Stack Licensing...
Shane Coughlan
PDF
Automated Test Case Repair Using Language Models
Lionel Briand
PDF
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
PPTX
Introduction to web development | MERN Stack
JosephLiyon
PDF
Designing Accessible Content Blocks (1).pdf
jaclynmennie1
PPTX
Wondershare Filmora Crack 14.5.18 + Key Full Download [Latest 2025]
HyperPc soft
PPTX
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
PDF
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
PPTX
For my supp to finally picking supp that work
necas19388
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
Building scalbale cloud native apps with .NET 8
GillesMathieu10
Mastering VPC Architecture Build for Scale from Day 1.pdf
Devseccops.ai
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
OpenChain Webinar - AboutCode - Practical Compliance in One Stack Licensing...
Shane Coughlan
Automated Test Case Repair Using Language Models
Lionel Briand
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
Introduction to web development | MERN Stack
JosephLiyon
Designing Accessible Content Blocks (1).pdf
jaclynmennie1
Wondershare Filmora Crack 14.5.18 + Key Full Download [Latest 2025]
HyperPc soft
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
For my supp to finally picking supp that work
necas19388
Ad

C++ chapter # 1

  • 2. SIMPLE CODING IN C++ #include <iostream> using namespace std; int main () { cout << My Name Is Ali ; return 0; }
  • 3. DEFINE HEADER FILE: This statement includes the header file into the application so that you are able to use the operations included in them. Also, you can create your own header files and include them in your program using the #include. Iostream: iostream is what you call the header file. It is a standard C++ input/output library file. It comes packaged with the compiler/IDE and contain mechanisms to get the information from the user and print same or added information to a file, screen or any other media.
  • 4. WHAT IS #INCLUDE? THE #INCLUDE IOSTREAM FILE, INTO THE PROGRAM. THIS ENSURES THAT NOW YOURE ABLE TO USE THE OPERATIONS, IOSTREAM OPERATIONS (LIKE: TAKING INPUT FROM USER, DISPLAYING OUTPUT ON THE SCREEN), IN THE PROGRAM.
  • 5. WHAT IS USING NAMESPACE STD;? The statement is intuitive in itself, you are using the namespace std in your file. We use the namespace std to make it easier to reference operations included in that namespace. If we hadnt used the namespace, wed have written std::cout instead of cout. This tells the compiler that every cout is actually std::cout. Whats a namespace? Its a region where your code resides. It limits or expands the scope of your code to one or more files. Why do you use namespace? Like two persons can have the same name, variables and functions in C++ can have same names as well. The use of namespace is to avoid the confusion of which variables/functions you are referencing to.
  • 6. SEMICOLON ; Ask any C++ programmer and they will tell you at least one horror story related to the semicolon ; . The semicolon is a terminal. It terminates a statement. When missed or incorrectly used, it will cause a lot of issues.
  • 7. INT MAIN() { } As the name suggests, it is the main function of the program. The code inside { } is called the body and is executed first when you run your C++ program. It is one code that is mandatory in a C++ program. If you just have this line of code alone, your program will be valid.
  • 8. COUT << ALI; This statement prints Ali onto the output screen. The cout is an object of standard output stream. What this means is, it outputs/prints the data after << , i.e: Ali into a stream (in this case, the output screen).
  • 9. WHAT IS A STREAM? STREAM IS BASICALLY A SEQUENCE OBJECTS, USUALLY BYTES. IT CAN DESCRIBE FILES, INPUT/OUTPUT TERMINAL, SOCKETS, ETC. WHAT IS <<? << IS THE INSERTION OPERATOR TO WRITE FORMATTED DATA INTO THE STREAM.
  • 10. WHAT IS RETURN 0;? THIS STATEMENT RETURNS 0 ZERO. THIS IS CALLED A RETURN STATEMENT. IT ISNT MANDATORY TO RETURN ANYTHING FROM THE FUNCTION BUT IS RATHER A CONVENTION. IF NOT RETURN, THE COMPILER RETURNS A STATUS AUTOMATICALLY. WHY ZERO IN RETURN STATEMENT? IT DENOTES EXIT STATUS OF THE APPLICATION THAT BASICALLY THE TELLS SYSTEM THE PROGRAM FINE.