Question 9
What are the final values of all variables in the following code?
int vienna = 12;
int graz = vienna + 13 % 4;
int salzburg = graz++ * 3;
int linz = --salzburg + vienna++;
int enns;
int zwettl;
enns = graz * salzburg;
zwettl = enns / 3 + salzburg;
graz -= enns;
salzburg += vienna;
zwettl = enns / 4 + salzburg;
vienna = 13 graz = -518 salzburg = 51 linz = 50 enns = 532 zwettl = 184
Question 9 What are the final values of all variables in the following code? int vienna...
3) What are the final values of a, b, c in the following code fragment (1.5 point): int a = 6 , b = 127 , c; c = ( ++a ) + ( b -- ); Answer: 4) What are the final values of a, b, c in the following code fragment (1.5 point): int a = 6 , b = 127 , c; c = (a++) + ( -- b); Answer: 5) What is displayed by this poorly...
A. What is the output of the following C++ code fragment? (all variables are of type int) int count-1; int y-100; while (count 3) y=y-1 ; count+t cout << y << endl; cout<< count <<endl What is the value of x after control leaves the following while loop? (all variables are of type int) B. int x0 while (x < 20) sum- sum+x cout << sum<< endl;
QUESTION 8 What (if anything) will be the output of the following code: int count = 3; while (count++ <= 6) { System.out.print(++count + " "); } 3 4 5 6 4 5 6 7 3 4 5 6 7 5 7 4 6 The above code contains a syntax error and will not run. 8 points QUESTION 9 What (if anything) will be the output of the following code: int count = 0; while (count < 5) {...
Question 21 What will be the results after the following code is executed? int[] arrayi = new int [25]; // Code that will put values in array1 int value = array1[0]; for (int a = 1; a < array1.length; a++) مه if (arrayl[a] < value) value = arrayi[a]; value contains the sum of all the values in arrayi value contains the lowest value in array1 value contains the average of all the values in array value contains the highest value...
The answer I've selected was incorrect. This code is in Java final int SIZE = 25; What would be the result after the following code is executed? int[] array1 = new int[SIZE]; ... // Code that will put values in arrayı int value = 0; for (int a = 0; & <= array1.length; a++) value += arrayl[a]; سیمه value contains the highest value in arrayl. value contains the lowest value in arrayl. value contains the sum of all the values...
QUESTION 1 What will be displayed as a result of executing the following code? int x = 5, y = 20; x += 32; y /= 4; cout <<"x = " << x <<"y = " << y; A. x = 32, y = 4 B. x = 9, y = 52 C. x = 37, y = 5 D. x = 160, y = 80 8 points QUESTION 2 What will be the displayed when the following code...
12. What is the output of the following C++ code? int x; int y; int *p = &x; int *q = &y; *p = 35; *q = 98; *p = *q; cout << x << " " << y << endl; cout << *p << " " << *q << endl; 13. What is the output of the following C++ code? int x; int y; int *p = &x; int *q = &y; x = 35; y = 46; p...
1. (TCO 1) What is the output of the following C++ code? int list[5] = {0, 5, 10, 15, 20}; int j; for (j = 0; j < 5; j++) cout << list[j]; (Points : 4) 0 1 2 3 4 0 5 10 15 0 5 10 15 20 5 10 15 20 Question 2.2. (TCO 1) What is stored in alpha after the following code executes? int alpha[5] = {0}; int j; for (j = 0; j...
Given the following code segment, int x = 20; int y = 7; what is the data type of the value of the expression (x % y) ? (3 points) Question 1 options: 1) int 2) double 3) numeric 4) Error: possible loss of precision 5) Unable to be determined Question 2 (3 points) Given the following code segment, double x = 42.3; double y = 11.7; what is the data type of the value of the expression (x %...
Question 31 -Given the following code fragment, what value is contained in myArr[O]? const int ARRAYSIZE 3 double() myArr new double [ARRAYSIZE] myArr [0]1.1 myArr [1]2.2; myArr [2] myArr [0] myArr[1 O3.3 2.2 O 1.1 0 Question 32 - Given the following code fragment, what is displayed in IblResult? const int ARRAYSIZE 3 double(] myArr - new double [ARRAYSIZE] myArr [0] - 1.1 myArr [1] 2.2 lblResult.Text - Convert.Tostring (myArr (01) 3.3 O 2.2 1.1 0 Question 33 - Given...