# Lec c1 - Todays Agenda ArithmeticOperators...

This preview shows pages 1–6. Sign up to view the full content.

14 th March 2009 Today’s Agenda  Operators and Expressions  Arithmetic Operators  Relational Operators  Logical Operators  Assignment Operators  Increment and Decrement Operators  Conditional Operators  Special Operators

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
14 th March 2009 Arithmetic Operators Operator Meaning + Addition  - Subtraction  * Multiplication / Division % Modulo Division
14 th March 2009 Arithmetic Expression   Let int x = 15; int y = 6; Example: x-y = 9 x+y = 21 x*y = 90 x/y = 2 (decimal part truncated) x%y = 3 (remainder of the division) Q. If x and y are declared as float then? Q. If x is integer and y is float then?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
14 th March 2009 More Examples: Write a equivalent  C expression for given algebraic   expressions. 1. (a+b)(c+d) 2. ax 2 +bx+c 1. π r 2 +2 π rh 1. s = ut + 1/2at 2 2. T = (m1m2/m1+m2)
14 th March 2009 Relational Operators   Operator Meaning < Is less than <= Is less than or equal to > Is greater than >= Is greater than or equal to == Is equal to != Is not equal to

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 15

Lec c1 - Todays Agenda ArithmeticOperators...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online