{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

4.Expressions

# 4.Expressions - Expressions 1 Arithmetic Expression It is...

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

Expressions

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

View Full Document
1. Arithmetic Expression: - It is composed of operands and arithmetic operations ( + , - , *, /, MOD). - Its result is a numeric value (e.g. 3 + 4 gives 7) - Operands may be numbers and/or identifiers that have numeric values e.g. x – y gives 4, if x is 6 and y is 2 x / 2 gives 6, if x 12 T MOD 2 gives 0 if T is any even number, and 1 if T is any odd number
2. Logical Expression: - It is called also Boolean expression . - It is composed from operands and operators. - Operands are identifiers that have logical values - Its result is a logical value ( true or false ) (see later). - Operators are logical: AND , OR, NOT e.g. X AND Y a AND b OR c where X, Y, a, b, c are defined logical

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

View Full Document
3. Relational Expression : - It is composed from operands and operators. - Operands may be numbers and/or identifiers that have numeric values - Its result is a logical value ( true or false ). - Operators are relational operators: <, >, =, ≠, ≤, ≥ e.g. (a < b) gives true , if value of a is less than value of b false , if value of a is not less than value of b (x ≠ y) also gives true or false according to the values of x and y
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern