ET 2560 Unit 4-Assignment 1-Overview of Program
1) Self-Check Pg. 184 #1: Assuming x is 15.0 and y is 25.0, what are the values of the following conditions (True/False)? (2 Points Each) x != y 1(True) x < x 0(False) x >= y - x 1(True) x == y + x - y 1(True) 2) Self-Check Pg. 184 #5: What value is assigned to the type int variable ans in this statement if the value of p is 100 and q is 50? (3 Points) ans = (P > 95) + (q < 95); 1(True) This statement is not shown as an example of a reasonable assignment statement; rather, it is a sample of a statement that makes little sense to the reader. The statement is still legal and executable in C, however, because C uses integers to represent the logical values true and false. 3) Self-Check Pg. 190 #1: What do these statements display? (5 Points Each) a) if (12 < 12) printf("less"); else printf("not less"); not less!< b)Varl = 25.12; Var2 = 15.00; if (Varl <= Var2) printf ("less or equal"); else printf( "greater than" ); greater than> 4) Self-Check Pg. 190 #2: What value is assigned to x when y is 10.0? (5 Points Each) a) x = 25.0; if (y != (x - 10.0)) x = x – 10.0; else x = x / 2.0; x=25.0; if (10.0=(x-10.0) x=x -10; else x=x / 2.0;
Written for
- Institution
- Portage Learning
- Module
- ET 2560
Document information
- Uploaded on
- December 17, 2021
- Number of pages
- 4
- Written in
- 2021/2022
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
et 2560 unit 4 assignment 1 overview of program