Copy of Topic No. 8, Expressions and operators.pdf

abdullahkhan824779 0 views 12 slides Oct 09, 2025
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

HEllo


Slide Content

Programming Fundamentals
Topic No. 8
Expressions and Operators
Hyderabad Institute for Technology & Management Sciences

Meet the teacher
Azhar Ali
Lecturer (2024-till date)
Instructor (2021-2024)
Hyderabad Institute for Technology & Management Sciences
Virtual University of Pakistan
IT Technical Support (2020-2021)
Sindh Agriculture University Tandojam
77-418: MOS: Microsoft Office Word 2013, 29
th
December 2017
77-420: MOS: Microsoft Office Excel 2013, 30
th
December 2018
Project funded by IGNITE, MoIT
Contact :
Email : [email protected]
Office: HITMS, Formerly Youth Hostel, Daman-e-Kohsar, Hyd
Schedule meeting? https://calendly.com/azharkhaskheli
Hyderabad Institute for Technology & Management Sciences

Hyderabad Institute for Technology & Management Sciences Hyderabad Institute for Technology & Management Sciences
How would you calculate total expenses?
How would you calculate total expenses of students?
What if there are 250 students?

Expression
Hyderabad Institute for Technology & Management Sciences
•expression is a combination of values, variables, and operators
•produces a single result or value.
•Examples
•A = B + C
•X = Y * Z
•X = Y / Z
Hyderabad Institute for Technology & Management Sciences

Operators
Hyderabad Institute for Technology & Management Sciences
•symbols or keywords used to perform specific operations on values or variables
•Assignment Operator
•Arithmetic Operators
•Relational Operators
•Logical Operators
Hyderabad Institute for Technology & Management Sciences

Arithmetic Operators
Hyderabad Institute for Technology & Management Sciences
•used to perform common mathematical operations.
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
++ Increment
-- Decrement
Hyderabad Institute for Technology & Management Sciences

Assignment Operator
Hyderabad Institute for Technology & Management Sciences
•used to assign values to variables
= Assignment Operator
example
variable = value;
Hyderabad Institute for Technology & Management Sciences

RelationalOperator
Hyderabad Institute for Technology & Management Sciences
•Used to compare two values (or variables)
•Find relation
== Equal to
!= Not Equal
> Greater
< Less than
>= Greater than or equal to
<= Less than or equal to
Hyderabad Institute for Technology & Management Sciences

LogicalOperator
Hyderabad Institute for Technology & Management Sciences
•used to determine the logic between variables or values
•Combine relational operators
&& Logical AND
|| Logical OR
! Logical NOT
Hyderabad Institute for Technology & Management Sciences

Make C++ expressions
Hyderabad Institute for Technology & Management Sciences
•Total marks of students obtained in Physics, Chemistry, English.
•Average of marks obtainer in Physics, Chemistry, English.
•Y = MX + B
•Y = B
2
–4AC
•A = X
3
–Y
3
+ ZA
2
C
4
•??????=
−&#3627408463;±&#3627408463;
2
−4&#3627408462;&#3627408464;
2&#3627408462;
Hyderabad Institute for Technology & Management Sciences

Make C++ Program
Hyderabad Institute for Technology & Management Sciences
•Ask user to enter marks of Physics, Chemistry, English, Mathsand Urdu.
•Print the total marks and obtained marks
•Print percentage of marks
Hyderabad Institute for Technology & Management Sciences