Lec20 - Computer Programming I TA C162. Today's Agenda...

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

View Full Document Right Arrow Icon
1 Computer Programming I TA C162 . 24/02/07 Today’s Agenda  Operators and Expressions  Arithmetic Operators  Relational Operators  Logical Operators  Assignment Operators  Increment and Decrement Operators  Conditional Operators  Bitwise Operators  Special Operators
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Computer Programming I TA C162 . 24/02/07 Arithmetic Operators Operator Meaning + Addition or unary plus - Subtraction or unary minus * Multiplication / Division % Modulo Division
Background image of page 2
3 Computer Programming I TA C162 . 24/02/07 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? 
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Computer Programming I TA C162 . 24/02/07 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)
Background image of page 4
5 Computer Programming I TA C162 . 24/02/07
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/07/2010 for the course CS&IS TA C162 taught by Professor Kavitha during the Spring '09 term at Birla Institute of Technology & Science.

Page1 / 17

Lec20 - Computer Programming I TA C162. Today's Agenda...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online