Values of Expressions with Given Variables, Lecture notes of Computer Programming

The values of several expressions using given variables char key, int i, int j, int k, and double x. The expressions include comparisons and arithmetic operations.

Typology: Lecture notes

2012/2013

Uploaded on 04/27/2013

kid
kid 🇮🇳

4.3

(18)

110 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Question 1
Let:
char key = ‘A’;
int i = 4, j =6 , k = 9;
double x = 12.5
Please give the values of the following expressions.
Expression Equivalent Expression Value
(1) i+2==k-1 (i+2)==(k-1) ?
(2) i+2*j>k (i+(2*j))>k ?
(3) ‘a’+1==‘b’ (‘a’+1)==‘b’ ?
(4) 25>+x+1.0 25>+(x+1.0) ?

Partial preview of the text

Download Values of Expressions with Given Variables and more Lecture notes Computer Programming in PDF only on Docsity!

Question 1 Let: char key = ‘A’; int i = 4, j =6 , k = 9; double x = 12. Please give the values of the following expressions. Expression Equivalent Expression Value (1) i+2==k-1 (i+2)==(k-1)? (2) i+2j>k (i+(2j))>k? (3) ‘a’+1==‘b’ (‘a’+1)==‘b’? (4) 25>+x+1.0 25>+(x+1.0)?