بليز ساعدوني في حل الواجب لاني مررره ماني فاضيه وعندي اختبارات هاذا كثرها وماني عارفه حل الواجب لاني مبتدئه
1. What is an expression?
2. Is x = 5 + 7 an expression? What is its value?
3. What is the value of 201 / 4?
4. What is the value of 201 % 4?
5. If myAge, a, and b are all int variables, what are their values after:
myAge = 39;
a = myAge++;
b = ++myAge;
6. What is the value of 8+2*3?
7. What is the difference between if(x = 3) and if(x == 3)?
8. Do the following values evaluate to TRUE or FALSE?
a. 0
b. 1
c. -1
d. x = 0
e. x == 0 // assume that x has the value of 0
9. Write a single if statement that examines two integer variables and changes the larger to the smaller, using only one else clause.
10. Examine the following program. Imagine entering three numbers, and write what output you expect.
1: #include <iostream.h>
2: int main()
3: {
4: int a, b, c;
5: cout << "Please enter three numbers\n";
6: cout << "a: ";
7: cin >> a;
8: cout << "\nb: ";
9: cin >> b;
10: cout << "\nc: ";
11: cin >> c;
12:
13: if (c = (a-B))
14 {
15: cout << "a: " << a << " minus b: ";
16: cout << b << " _equals c: " << c;
17: }
15: else
16: cout << "a-b does not equal c: ";
17: return 0;
18: }
11. Enter the program from Exercise 2; compile, link, and run it. Enter the numbers 20, 10, and 50. Did you get the output you expected? Why not?