1. Which of the following is an invalid C++ identifier? (Points : 5) TwoForOne A
ID: 3533866 • Letter: 1
Question
1. Which of the following is an invalid C++ identifier? (Points : 5) TwoForOne A_+_B two_for_one A_plus_B 2. Which of the following translates code written in a high-level language into machine language? (Points : 5) Assembler Compiler Preprocessor Linker 3. For the values given, what will c contain after executing the following? int a = 9, b = 4, c = -1; c = a / b - 1; (Points : 5) 3 1.25 1 -1 4. For the values given, what will c contain after executing the following? int a = 9, b = 4, c = -1; c *= --b * a; (Points : 5) 27 -36 -27 36 5. A slash sign (/) is called (Points : 5) the separation operator. the divide operator. the slash operator. None of the above 6. What is the result of 56 % 10? (Points : 5) 10 5 5.6 6 7. What is the output for the following code fragment? int var1 = 20; cout << var1--; cout << ++var1; (Points : 5) 1920 1921 2020 2021 8. Which operation in the following expression will be performed first? c = a++ / b + 5; (Points : 5) a++ a / b b + 5 assignment to c 9. The endl manipulator _______. (Points : 5) requires #include is used with cout to display a new line only works with cin statements All of the above 10. Which of the following would you add to your program to read an entire line of input into a string variable named input? (Points : 5) cin >> input; cin.getline(input); getline(cin, input); cin << input; 11. Which statement outputs a double value in a field of five characters with two digits after the decimal point? (Points : 5) cout << 5chars << 2digits << 1.23; cout << setprecision(2) << setw(5) << 1.2345678; cout << fixed << setprecision(2) << 1.23; cout >> setw(2) >> setprecision(5) >> 1.23;Explanation / Answer
1) A_+_B
2)Compiler
3) c= 1
4) c = 36
5)slash operator
6) 6
7) 2021
8) a/b
9) is used with cout to display a new line
10) cin >> input
11) cout >> setw(2) >> setprecision(5) >> 1.23
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.