SlideShare a Scribd company logo
1 of 60
Download to read offline
By Fiaz Younas
 A program written in a high-level language is called
source code.
 Source code is also called Source program.
 Source code of high-level language is save with a
specific extension.
 For example the program written in c++ save with .ccp
extension.
#include<iostream> //preprocessor directives
Using namespace std; //std stand for symbols
int main() //main function
{
Cout<<“MY First c++ Program”;
System(“pause”);
}
 Compiler is a program that converts the instructions of
a high level language into machine language as a
whole.
 High-level language[Source code]:
 Machine Language[ Object Code]:
 Use the compiler to:
 Check the program that obey rules.
 Translate the program into machine language.
Source code Compiler Object code
 Compiler can translate the programs of only those
language for which it is written.
 For example c++ compiler can translate only those
program that are written in c++ language.
 The process of linking the library files with object
program is known as linking. These files accomplish
different task such as input output.
 A program that combines the object program with
additional library files is known as linker.
 This additional library files is used to create the
executable file whose extension is .exe .
 After compiling and linking the program file the new
file is created that is known as executable file.
 The process of running an executable file is known as
executing.
 The program must be loaded into main memory for
execution.
 A program that load the executable file into main
memory is known as loader.
 A collection of rules for writing program in a
programming language is known as syntax.
 Basic structure of c++ program:
#include<iostream>
using namespace std;
int main()
{
Cout<<“Program body”;
System(“pause”);
}
 Define a set of values and a set of operation on those
values.
Category of c++ data types:
1. Simple data type
2. Structure data type
3. Pointer data type
Simple data type:
 A data type is called simple if variable of that type
can store only one value at a time. e.g. int a float b;
 Simple data type is building block of structure data
type.
 Integral:
integers (numbers without a decimal) e.g.
12,34 etc
 Floating-point:
decimal numbers e.g.12.34 ,45.5
 Enumeration type:
user-defined data type
Syntax of declare a variable and data type:
Datatype variable_name;
 int data type:
 Integers in C++, as in mathematics, are numbers such
as the following:
 -6728, -67, 0, 78, 36782, +763
Note the following two rules from these examples:
1. Positive integers do not need a + sign in front of them.
2. No commas are used within an integer. Recall that in
C++, commas are used to separate items in a list. So
36,782 would be interpreted as two integers: 36 and
782
Bool DATA TYPE:
 The data type bool has only two values : true and false.
 The central purpose of this data type is to manipulate
logical (Boolean) expressions.
Char DATA TYPE:
 The data type char is the smallest integral data type.
 It is mainly used to represent characters—that is,
letters, digits, and special symbols.
 e.g. 'A','a','0','*','+','$','&',''
 To deal with decimal numbers, C++ provides the
floating-point data type.
 It is also called real type data. It include positive and
negative values.
Types of Floating Point:
1. Float
2. Double
3. Long double
Data type Size in Bytes Description
Float 4 3.4 x10^-38 to 3.4 x10^+38
Double 8 1.7x10^-308 to1.7x10^+308
Long double 10 1.7x10^-4932 to1.7x10^+4932
Structure data type
 Each data item is a collection of other data items.
 E.g. array , structure , classes.
Pointer data type:
 The values belonging to pointer data types are the
memory addresses of your computer.
 pointer variables store memory addresses.
Syntax for pointer declaration:
dataType*variable;
 Operator are the symbols that are used to perform
certain operations on data.
C++ provides a variety of operators.
1. Arithmetic Operators
2. Relations Operations
3. Logical Operations
4. Assignments Operators
5. Increment and decrement Operators
6. Compound Assignment Operators
 Arithmetic operator is a symbol that performs
mathematical operation on data.
 C++ provides many arithmetic operators.
Operators Symbol Descriptions
Addition + Adds two values
Subtraction - Subtracts one from another
value
Multiplication * Multiplies two values
Division / Divides one by another
value
Modulus % Give the remainder of
division of tow integers
 Example if A=10 and B=5 then arithmetic operator and
results
Operation Result
A+B 15
A-B 5
A*B 50
A/b 2
A%B 0
 The relational operators are used to specify conditions
in program.
 A relational operators compare two values.
 Also called comparison operators.
C++ provides the following six relational operators with
their description:
 Greater than[>]:
Greater than operator returns true if the value on left
side of > greater than the value on the right side.
Otherwise returns false.
 Less than [<]:
Less than operator returns true if the value on left
side of < less than the value on the right side.
Otherwise returns false.
 Equal to ==:
Equal to operator returns true if the value on both
side of = equal. Otherwise returns false.
 Greater than or equal to [>=]:
Greater than or equal to operator returns true if the
value on left side of >= greater than or equal to the
value on the right side. Otherwise returns false.
 Less than or equal to [<=]:
Less than or equal to operator returns true if the
value on left side of <= less than or equal to the value
on the right side. Otherwise returns false.
 Not Equal to !=:
Not Equal to operator returns true if the value on left
side of != is not equal to the value on the right .
Otherwise returns false.
 Example if A=10 and B =5 the relational operator and
their result
Relational Expression Result
A>B True
A<B False
A<=B False
A>=B False
A==B False
A!=B True
 The Logical operators are used to evaluate compound
condition.
 Logical operators are as follows:
1. AND Operators(&&)
2. OR Operators(||)
3. NOT Operators(!)
1) AND Operators(&&)
The symbols used for AND operator is (&&).
 It is used to evaluate two condition.
 It produce result true if both condition is true.
 It produce result false if any of the condition is false.
Condition 1 Operator Condition 2 Result
False && False False
False && True False
True && False False
True && True True
Example:
 Suppose we have tow variables A=100 and B=50. the
compound condition (A>10) &&(B>10) is true .it
contain two conditions and both are true. So whole
compound condition is true.
 The compound condition (A>50) &&(B>50) is false. it
contain two conditions one is true and one is false. So
whole compound condition is false.
2) OR Operators(||)
The symbols used for OR operator is (||).
 It is used to evaluate two condition.
 It produce result true if any of the condition is true.
 It produce result false if both condition are false
Condition 1 Operator Condition 2 Result
False || False False
False || True True
True || False True
True || True True
 Example:
Suppose we have tow variables A=100 and B=50. the
compound condition (A>50) ||(B>50) is true .it contain
two conditions and one condition is true. So whole
compound condition is true.
 The compound condition (A>500) ||(B>500) is false. it
contain two conditions and both are false. So whole
compound condition is false.
3) NOT Operators(!)
 The symbol used for NOT is (!).
 It is used to reverse the result of a condition
 It produces true if the condition is false.
 It produces false if the condition is true.
Example:
 Suppose we have tow variables A=100 and B=50. the
condition !(A==B) is true .The result of (A==B) is false but
NOT operator converts it into true.
 The condition !(A>B) is false .The result of (A>B) is true
but NOT operator converts it into false.
 The assignment operator = is used in assignment
statement to assign a value or computational result to a
variable.
Syntax:
Variable_name= expression;
Variable_name it is the name of variable
= it the assignment operator
Expression it is any valid expression
; statement terminator
 The increment operator is used to increase the value of
variable by one.
 It is denoted by the symbol ++.
 The increment operator cannot increment the value of
constants and expressions.
 For example:
Valid statements Invalid statements
A++,x++ 10++
(a+b)++,or ++(a+b)
Forms of increment operator:
 Prefix
In prefix form ,the increment operator is written before
the variable as follows:
++y;
 Postfix
In postfix form ,the increment operator is written after
the variable as follows:
y++;
 Let A=++B and A=B++ are different:
In prefix: A=++B
 It increment the value of B by one.
 It assign the value of B to A.
++B;
A=B;
In postfix: A=B++
 It assign the value of B to A.
 It increment the value of B by one.
A=B;
++B;
 The decrement operator is used to decrease the value
of variable by one.
 It is denoted by the symbol --.
 The decrement operator cannot decrement the value
of constants and expressions.
 For example:
Valid statements Invalid statements
A--,x-- 10--
(a+b)--,or --(a+b)
Forms of decrement operator:
 Prefix
In prefix form ,the decrement operator is written before
the variable as follows:
--y;
 Postfix
In postfix form ,the decrement operator is written after
the variable as follows:
y--;
 Let A=--B and A=B--are different:
In prefix: A=--B
 It decrement the value of B by one.
 It assign the value of B to A.
--B;
A=B;
In postfix: A=B--
 It assign the value of B to A.
 It increment the value of B by one.
A=B;
--B;
 That combine assignment operator with arithmetic
operators.
 We are used to perform mathematical operator more
easily.
Syntax:
 Variable op=expression
 E.g. N+=10; is equalvent to N=N+10;
 The syntax of cout and << is:
 Called an output statement
 The stream insertion operator is <<
 Expression evaluated and its value is printed at the
current cursor position on the screen
 cin is used with >> to gather input
 The stream extraction operator is >>
 For example,
cin >>a;
 Causes computer to get a value of type int
 Places it in the variable a
 If statement
 If else statement
 If- else –if statement
 Nested if statement
 Switch case statement
 If is a decision-making statement.
 It is the simplest form of decision statement.
Syntax:
If(condition)
{
Statement1;
Statement2;
.
.
StatementN;
}
 Condition is given as relational expression.
 If the condition is true the statement or set of
statement is executed.
 If the condition is false the statement or set of
statement is not executed.
#include<iostream>
using namespace std;
int main()
{
int a;
cin>>a;
if(a>40)
cout<<"you are pass";
system("pause");
}
 It execute one block of statement when the condition it
true and the other if the condition is false.
 In any situation, one block is executed and the other
 Is skipped.
Syntax:
If(condition)
{
Statement(s);
}else
{
Statement(s);
}
#include<iostream>
using namespace std;
int main()
{
int a;
cin>>a;
if(a>40)
cout<<"you are pass";
else
cout<<"you are fail";
system("pause");
}
 Use to choose one block of statements from many
block of statements.
 It is used when there are many option and only one
block of statement should be executed on the basis of
a condition.
Syntax:
If(condition)
{
Block 1;
}
else if(condition)
{
Block2;
}
Else
{
Block N;
}
#include<iostream>
using namespace std;
int main()
{
int a;
cout<<"enter a number";
cin>>a;
if(a>0)
cout<<"the number is positive";
else if(a<0)
cout<<"the number is negative";
else
cout<<"the number is zero";
system("pause");
}
 An if statement within an if statement is called nested
if statement.
 In structure, the enter into the inner if only when the
outer condition is true.
 If the condition is false the control moves to the outer
part of the outer if and skipped the inner if statement.
 It is an alternative of nested if statement.
 It can be used easily when there are many choices available and only one should be executed.
Syntax:
Switch(expression)
{
case val 1:
Statements1;
break;
.
.
case val n:
Statements1;
break;
Default:
Statements1;
}
LOOP:
 For Loop
 While Loop
 Do while Loop
 For loop execute one or more statement for a specified
number of times.
 Syntax:
For( intialization ; condition ; increment/decrement )
{
Statement(s);
}
 #include<iostream>
 using namespace std;
 int main()
 {
 int n;
 for(n=1;n<=5;n++)
 cout<<n<<endl;
 system("pause");
 }
 While loop executes one or more statement while the
given condition remain true.
 It is useful where the number of iterations is not know
in advance.
 Condition become before the body of loop.
 Syntax:
While(condition)
{
Statement(s);
}
#include<iostream>
using namespace std;
int main()
{
int n=1;
while(n<=5)
{
cout<<"Pakistan"<<endl;
n++;
}
system("pause");
}
 Do while loop executes one or more statement while the
given condition remain true.
 Important where a statement must be executed at least
once.
 Condition become after the body of loop.
Syntax
Do
{
Statement(s)
}
While(condition);
#include<iostream>
using namespace std;
int main()
{
int c=1;
do
{
cout<<c<<endl;
c++;
}
while(c<=10);
system("pause");
}

More Related Content

What's hot

Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Deepak Singh
 
Python Basic Operators
Python Basic OperatorsPython Basic Operators
Python Basic OperatorsSoba Arjun
 
Variables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detailVariables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detailgourav kottawar
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till nowAmAn Singh
 
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inLearnbayin
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming Kamal Acharya
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++Pranav Ghildiyal
 
Operators in Python
Operators in PythonOperators in Python
Operators in PythonAnusuya123
 
C Prog. - Operators and Expressions
C Prog. - Operators and ExpressionsC Prog. - Operators and Expressions
C Prog. - Operators and Expressionsvinay arora
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++Neeru Mittal
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 

What's hot (19)

Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
 
Python Basic Operators
Python Basic OperatorsPython Basic Operators
Python Basic Operators
 
Variables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detailVariables, Data Types, Operator & Expression in c in detail
Variables, Data Types, Operator & Expression in c in detail
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming
 
Python Operators
Python OperatorsPython Operators
Python Operators
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
C# operators
C# operatorsC# operators
C# operators
 
Operator.ppt
Operator.pptOperator.ppt
Operator.ppt
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
C Prog. - Operators and Expressions
C Prog. - Operators and ExpressionsC Prog. - Operators and Expressions
C Prog. - Operators and Expressions
 
Operators in c++
Operators in c++Operators in c++
Operators in c++
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
Python operators
Python operatorsPython operators
Python operators
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
Operators
OperatorsOperators
Operators
 

Viewers also liked

Makerere university places of worship
Makerere university places of worshipMakerere university places of worship
Makerere university places of worshipamogin
 
The good and bad about Makerere University
The good and bad about Makerere UniversityThe good and bad about Makerere University
The good and bad about Makerere Universityamogin
 
Makerere university Challenges
Makerere university ChallengesMakerere university Challenges
Makerere university ChallengesA75
 
makerere university
makerere universitymakerere university
makerere universitynajib36
 
THE BEAUTY AND THE BEAST IN MAKERERE UNIVERSITY
THE BEAUTY AND THE BEAST IN MAKERERE UNIVERSITYTHE BEAUTY AND THE BEAST IN MAKERERE UNIVERSITY
THE BEAUTY AND THE BEAST IN MAKERERE UNIVERSITYkushjulie
 
Makerere University Powerpoint presentation
Makerere University Powerpoint presentationMakerere University Powerpoint presentation
Makerere University Powerpoint presentationTimothy Atwiine
 
Презентация системы мониторинга и диспетчеризации (заметки)
Презентация системы мониторинга и диспетчеризации (заметки)Презентация системы мониторинга и диспетчеризации (заметки)
Презентация системы мониторинга и диспетчеризации (заметки)Sergei Smalkov
 
Clownaround pdf
Clownaround pdfClownaround pdf
Clownaround pdfaimperato
 
Bai giang thay_dinh_thanh_tung_full
Bai giang thay_dinh_thanh_tung_fullBai giang thay_dinh_thanh_tung_full
Bai giang thay_dinh_thanh_tung_fulltkkg92
 
Galería mañana cultural
Galería mañana culturalGalería mañana cultural
Galería mañana culturalnathalydeniss
 
Презентация территориально распределенной системы мониторинга и диспетчеризации
Презентация территориально распределенной системы мониторинга и диспетчеризацииПрезентация территориально распределенной системы мониторинга и диспетчеризации
Презентация территориально распределенной системы мониторинга и диспетчеризацииSergei Smalkov
 
Excursión Frómista, Carrión de los Condes
Excursión Frómista,  Carrión de los CondesExcursión Frómista,  Carrión de los Condes
Excursión Frómista, Carrión de los Condesextraescolares-Palencia
 
Makerere University
Makerere UniversityMakerere University
Makerere Universityseerah
 
Analysis sequences and bounded sequences
Analysis sequences and bounded sequencesAnalysis sequences and bounded sequences
Analysis sequences and bounded sequencesSANDEEP VISHANG DAGAR
 

Viewers also liked (20)

Makerere university places of worship
Makerere university places of worshipMakerere university places of worship
Makerere university places of worship
 
The good and bad about Makerere University
The good and bad about Makerere UniversityThe good and bad about Makerere University
The good and bad about Makerere University
 
Makerere university Challenges
Makerere university ChallengesMakerere university Challenges
Makerere university Challenges
 
makerere university
makerere universitymakerere university
makerere university
 
THE BEAUTY AND THE BEAST IN MAKERERE UNIVERSITY
THE BEAUTY AND THE BEAST IN MAKERERE UNIVERSITYTHE BEAUTY AND THE BEAST IN MAKERERE UNIVERSITY
THE BEAUTY AND THE BEAST IN MAKERERE UNIVERSITY
 
Makerere University Powerpoint presentation
Makerere University Powerpoint presentationMakerere University Powerpoint presentation
Makerere University Powerpoint presentation
 
La llorona
La lloronaLa llorona
La llorona
 
Презентация системы мониторинга и диспетчеризации (заметки)
Презентация системы мониторинга и диспетчеризации (заметки)Презентация системы мониторинга и диспетчеризации (заметки)
Презентация системы мониторинга и диспетчеризации (заметки)
 
La granja
La granjaLa granja
La granja
 
Clownaround pdf
Clownaround pdfClownaround pdf
Clownaround pdf
 
Bai giang thay_dinh_thanh_tung_full
Bai giang thay_dinh_thanh_tung_fullBai giang thay_dinh_thanh_tung_full
Bai giang thay_dinh_thanh_tung_full
 
Galería mañana cultural
Galería mañana culturalGalería mañana cultural
Galería mañana cultural
 
Презентация территориально распределенной системы мониторинга и диспетчеризации
Презентация территориально распределенной системы мониторинга и диспетчеризацииПрезентация территориально распределенной системы мониторинга и диспетчеризации
Презентация территориально распределенной системы мониторинга и диспетчеризации
 
Leonora 468
Leonora 468 Leonora 468
Leonora 468
 
22de dic2015 premios escuel adearte
22de dic2015 premios escuel adearte22de dic2015 premios escuel adearte
22de dic2015 premios escuel adearte
 
Excursión Frómista, Carrión de los Condes
Excursión Frómista,  Carrión de los CondesExcursión Frómista,  Carrión de los Condes
Excursión Frómista, Carrión de los Condes
 
Makerere University
Makerere UniversityMakerere University
Makerere University
 
Social ppt3
Social ppt3Social ppt3
Social ppt3
 
Analysis sequences and bounded sequences
Analysis sequences and bounded sequencesAnalysis sequences and bounded sequences
Analysis sequences and bounded sequences
 
Presentation
PresentationPresentation
Presentation
 

Similar to Programming presentation

Oop with c++ notes unit 01 introduction
Oop with c++ notes   unit 01 introductionOop with c++ notes   unit 01 introduction
Oop with c++ notes unit 01 introductionAnanda Kumar HN
 
C programming session 02
C programming session 02C programming session 02
C programming session 02Dushmanta Nath
 
PE1 Module 2.ppt
PE1 Module 2.pptPE1 Module 2.ppt
PE1 Module 2.pptbalewayalew
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till nowAmAn Singh
 
Ap Power Point Chpt2
Ap Power Point Chpt2Ap Power Point Chpt2
Ap Power Point Chpt2dplunkett
 
B.sc CSIT 2nd semester C++ Unit2
B.sc CSIT  2nd semester C++ Unit2B.sc CSIT  2nd semester C++ Unit2
B.sc CSIT 2nd semester C++ Unit2Tekendra Nath Yogi
 
2.overview of c#
2.overview of c#2.overview of c#
2.overview of c#Raghu nath
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2Don Dooley
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzationKaushal Patel
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programmingsavitamhaske
 
Cse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expressionCse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expressionFarshidKhan
 

Similar to Programming presentation (20)

C program
C programC program
C program
 
Oop with c++ notes unit 01 introduction
Oop with c++ notes   unit 01 introductionOop with c++ notes   unit 01 introduction
Oop with c++ notes unit 01 introduction
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
PE1 Module 2.ppt
PE1 Module 2.pptPE1 Module 2.ppt
PE1 Module 2.ppt
 
Operators
OperatorsOperators
Operators
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
Coper in C
Coper in CCoper in C
Coper in C
 
Ap Power Point Chpt2
Ap Power Point Chpt2Ap Power Point Chpt2
Ap Power Point Chpt2
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
 
B.sc CSIT 2nd semester C++ Unit2
B.sc CSIT  2nd semester C++ Unit2B.sc CSIT  2nd semester C++ Unit2
B.sc CSIT 2nd semester C++ Unit2
 
C basics
C basicsC basics
C basics
 
C basics
C basicsC basics
C basics
 
2.overview of c#
2.overview of c#2.overview of c#
2.overview of c#
 
Operators and it's type
Operators and it's type Operators and it's type
Operators and it's type
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
Operators
OperatorsOperators
Operators
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzation
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
Cse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expressionCse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expression
 

Recently uploaded

GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 

Recently uploaded (20)

GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 

Programming presentation

  • 2.  A program written in a high-level language is called source code.  Source code is also called Source program.  Source code of high-level language is save with a specific extension.  For example the program written in c++ save with .ccp extension.
  • 3. #include<iostream> //preprocessor directives Using namespace std; //std stand for symbols int main() //main function { Cout<<“MY First c++ Program”; System(“pause”); }
  • 4.  Compiler is a program that converts the instructions of a high level language into machine language as a whole.  High-level language[Source code]:  Machine Language[ Object Code]:  Use the compiler to:  Check the program that obey rules.  Translate the program into machine language. Source code Compiler Object code
  • 5.  Compiler can translate the programs of only those language for which it is written.  For example c++ compiler can translate only those program that are written in c++ language.
  • 6.  The process of linking the library files with object program is known as linking. These files accomplish different task such as input output.  A program that combines the object program with additional library files is known as linker.  This additional library files is used to create the executable file whose extension is .exe .
  • 7.  After compiling and linking the program file the new file is created that is known as executable file.  The process of running an executable file is known as executing.  The program must be loaded into main memory for execution.  A program that load the executable file into main memory is known as loader.
  • 8.
  • 9.  A collection of rules for writing program in a programming language is known as syntax.  Basic structure of c++ program: #include<iostream> using namespace std; int main() { Cout<<“Program body”; System(“pause”); }
  • 10.  Define a set of values and a set of operation on those values. Category of c++ data types: 1. Simple data type 2. Structure data type 3. Pointer data type Simple data type:  A data type is called simple if variable of that type can store only one value at a time. e.g. int a float b;  Simple data type is building block of structure data type.
  • 11.  Integral: integers (numbers without a decimal) e.g. 12,34 etc  Floating-point: decimal numbers e.g.12.34 ,45.5  Enumeration type: user-defined data type Syntax of declare a variable and data type: Datatype variable_name;
  • 12.  int data type:  Integers in C++, as in mathematics, are numbers such as the following:  -6728, -67, 0, 78, 36782, +763 Note the following two rules from these examples: 1. Positive integers do not need a + sign in front of them. 2. No commas are used within an integer. Recall that in C++, commas are used to separate items in a list. So 36,782 would be interpreted as two integers: 36 and 782
  • 13. Bool DATA TYPE:  The data type bool has only two values : true and false.  The central purpose of this data type is to manipulate logical (Boolean) expressions. Char DATA TYPE:  The data type char is the smallest integral data type.  It is mainly used to represent characters—that is, letters, digits, and special symbols.  e.g. 'A','a','0','*','+','$','&',''
  • 14.  To deal with decimal numbers, C++ provides the floating-point data type.  It is also called real type data. It include positive and negative values. Types of Floating Point: 1. Float 2. Double 3. Long double
  • 15. Data type Size in Bytes Description Float 4 3.4 x10^-38 to 3.4 x10^+38 Double 8 1.7x10^-308 to1.7x10^+308 Long double 10 1.7x10^-4932 to1.7x10^+4932
  • 16. Structure data type  Each data item is a collection of other data items.  E.g. array , structure , classes. Pointer data type:  The values belonging to pointer data types are the memory addresses of your computer.  pointer variables store memory addresses. Syntax for pointer declaration: dataType*variable;
  • 17.  Operator are the symbols that are used to perform certain operations on data. C++ provides a variety of operators. 1. Arithmetic Operators 2. Relations Operations 3. Logical Operations 4. Assignments Operators 5. Increment and decrement Operators 6. Compound Assignment Operators
  • 18.  Arithmetic operator is a symbol that performs mathematical operation on data.  C++ provides many arithmetic operators. Operators Symbol Descriptions Addition + Adds two values Subtraction - Subtracts one from another value Multiplication * Multiplies two values Division / Divides one by another value Modulus % Give the remainder of division of tow integers
  • 19.  Example if A=10 and B=5 then arithmetic operator and results Operation Result A+B 15 A-B 5 A*B 50 A/b 2 A%B 0
  • 20.  The relational operators are used to specify conditions in program.  A relational operators compare two values.  Also called comparison operators. C++ provides the following six relational operators with their description:  Greater than[>]: Greater than operator returns true if the value on left side of > greater than the value on the right side. Otherwise returns false.
  • 21.  Less than [<]: Less than operator returns true if the value on left side of < less than the value on the right side. Otherwise returns false.  Equal to ==: Equal to operator returns true if the value on both side of = equal. Otherwise returns false.  Greater than or equal to [>=]: Greater than or equal to operator returns true if the value on left side of >= greater than or equal to the value on the right side. Otherwise returns false.
  • 22.  Less than or equal to [<=]: Less than or equal to operator returns true if the value on left side of <= less than or equal to the value on the right side. Otherwise returns false.  Not Equal to !=: Not Equal to operator returns true if the value on left side of != is not equal to the value on the right . Otherwise returns false.
  • 23.  Example if A=10 and B =5 the relational operator and their result Relational Expression Result A>B True A<B False A<=B False A>=B False A==B False A!=B True
  • 24.  The Logical operators are used to evaluate compound condition.  Logical operators are as follows: 1. AND Operators(&&) 2. OR Operators(||) 3. NOT Operators(!) 1) AND Operators(&&) The symbols used for AND operator is (&&).  It is used to evaluate two condition.  It produce result true if both condition is true.  It produce result false if any of the condition is false.
  • 25. Condition 1 Operator Condition 2 Result False && False False False && True False True && False False True && True True
  • 26. Example:  Suppose we have tow variables A=100 and B=50. the compound condition (A>10) &&(B>10) is true .it contain two conditions and both are true. So whole compound condition is true.  The compound condition (A>50) &&(B>50) is false. it contain two conditions one is true and one is false. So whole compound condition is false.
  • 27. 2) OR Operators(||) The symbols used for OR operator is (||).  It is used to evaluate two condition.  It produce result true if any of the condition is true.  It produce result false if both condition are false Condition 1 Operator Condition 2 Result False || False False False || True True True || False True True || True True
  • 28.  Example: Suppose we have tow variables A=100 and B=50. the compound condition (A>50) ||(B>50) is true .it contain two conditions and one condition is true. So whole compound condition is true.  The compound condition (A>500) ||(B>500) is false. it contain two conditions and both are false. So whole compound condition is false.
  • 29. 3) NOT Operators(!)  The symbol used for NOT is (!).  It is used to reverse the result of a condition  It produces true if the condition is false.  It produces false if the condition is true. Example:  Suppose we have tow variables A=100 and B=50. the condition !(A==B) is true .The result of (A==B) is false but NOT operator converts it into true.  The condition !(A>B) is false .The result of (A>B) is true but NOT operator converts it into false.
  • 30.  The assignment operator = is used in assignment statement to assign a value or computational result to a variable. Syntax: Variable_name= expression; Variable_name it is the name of variable = it the assignment operator Expression it is any valid expression ; statement terminator
  • 31.  The increment operator is used to increase the value of variable by one.  It is denoted by the symbol ++.  The increment operator cannot increment the value of constants and expressions.  For example: Valid statements Invalid statements A++,x++ 10++ (a+b)++,or ++(a+b)
  • 32. Forms of increment operator:  Prefix In prefix form ,the increment operator is written before the variable as follows: ++y;  Postfix In postfix form ,the increment operator is written after the variable as follows: y++;
  • 33.  Let A=++B and A=B++ are different: In prefix: A=++B  It increment the value of B by one.  It assign the value of B to A. ++B; A=B; In postfix: A=B++  It assign the value of B to A.  It increment the value of B by one. A=B; ++B;
  • 34.  The decrement operator is used to decrease the value of variable by one.  It is denoted by the symbol --.  The decrement operator cannot decrement the value of constants and expressions.  For example: Valid statements Invalid statements A--,x-- 10-- (a+b)--,or --(a+b)
  • 35. Forms of decrement operator:  Prefix In prefix form ,the decrement operator is written before the variable as follows: --y;  Postfix In postfix form ,the decrement operator is written after the variable as follows: y--;
  • 36.  Let A=--B and A=B--are different: In prefix: A=--B  It decrement the value of B by one.  It assign the value of B to A. --B; A=B; In postfix: A=B--  It assign the value of B to A.  It increment the value of B by one. A=B; --B;
  • 37.  That combine assignment operator with arithmetic operators.  We are used to perform mathematical operator more easily. Syntax:  Variable op=expression  E.g. N+=10; is equalvent to N=N+10;
  • 38.  The syntax of cout and << is:  Called an output statement  The stream insertion operator is <<  Expression evaluated and its value is printed at the current cursor position on the screen
  • 39.  cin is used with >> to gather input  The stream extraction operator is >>  For example, cin >>a;  Causes computer to get a value of type int  Places it in the variable a
  • 40.  If statement  If else statement  If- else –if statement  Nested if statement  Switch case statement
  • 41.  If is a decision-making statement.  It is the simplest form of decision statement. Syntax: If(condition) { Statement1; Statement2; . . StatementN; }
  • 42.  Condition is given as relational expression.  If the condition is true the statement or set of statement is executed.  If the condition is false the statement or set of statement is not executed.
  • 43. #include<iostream> using namespace std; int main() { int a; cin>>a; if(a>40) cout<<"you are pass"; system("pause"); }
  • 44.  It execute one block of statement when the condition it true and the other if the condition is false.  In any situation, one block is executed and the other  Is skipped. Syntax: If(condition) { Statement(s); }else { Statement(s); }
  • 45. #include<iostream> using namespace std; int main() { int a; cin>>a; if(a>40) cout<<"you are pass"; else cout<<"you are fail"; system("pause"); }
  • 46.  Use to choose one block of statements from many block of statements.  It is used when there are many option and only one block of statement should be executed on the basis of a condition.
  • 48. #include<iostream> using namespace std; int main() { int a; cout<<"enter a number"; cin>>a; if(a>0) cout<<"the number is positive"; else if(a<0) cout<<"the number is negative"; else cout<<"the number is zero"; system("pause"); }
  • 49.  An if statement within an if statement is called nested if statement.  In structure, the enter into the inner if only when the outer condition is true.  If the condition is false the control moves to the outer part of the outer if and skipped the inner if statement.
  • 50.
  • 51.
  • 52.  It is an alternative of nested if statement.  It can be used easily when there are many choices available and only one should be executed. Syntax: Switch(expression) { case val 1: Statements1; break; . . case val n: Statements1; break; Default: Statements1; }
  • 53.
  • 54. LOOP:  For Loop  While Loop  Do while Loop
  • 55.  For loop execute one or more statement for a specified number of times.  Syntax: For( intialization ; condition ; increment/decrement ) { Statement(s); }
  • 56.  #include<iostream>  using namespace std;  int main()  {  int n;  for(n=1;n<=5;n++)  cout<<n<<endl;  system("pause");  }
  • 57.  While loop executes one or more statement while the given condition remain true.  It is useful where the number of iterations is not know in advance.  Condition become before the body of loop.  Syntax: While(condition) { Statement(s); }
  • 58. #include<iostream> using namespace std; int main() { int n=1; while(n<=5) { cout<<"Pakistan"<<endl; n++; } system("pause"); }
  • 59.  Do while loop executes one or more statement while the given condition remain true.  Important where a statement must be executed at least once.  Condition become after the body of loop. Syntax Do { Statement(s) } While(condition);
  • 60. #include<iostream> using namespace std; int main() { int c=1; do { cout<<c<<endl; c++; } while(c<=10); system("pause"); }