iteration 1: x = 10/2 = 5 y = 1 iteration 2: x = 5/2 = 2 y = 2 iteration 3: x = 2/2 = 1 y = 3 iteration 4: x = 1/2 = 0 y = 4 so, final value of y is 4 Answer: a) 4
java by the way What is the value of the variable y after the following code...
question is from a java quiz
Based on the following code, what is the value of y if x = 5? int x, y; if (x < 4) у 2; else if (x > 4) = { if (x > 7) y = 4; else y = 6; } else y = 8; 6 8 2 O 4
When the Java source code below is executed, how many times is the boolean expression (j > 0) evaluated? int i 1; do { int j 35; while (j > 0) { j = j / 2; = } i += 1; } while (i <= 3); 18 none of the other answers are correct 0 6 36
Question 68 (Mandatory) (1 point) When the Java source code below is executed, how many times is the boolean expression (j > 0) evaluated? = int i 1; int p 0; while (i <= 2) for(int j = 28; (j > 0); j /= 2) { p+= 5; { } i i + 1; مه none of the other answers are correct 12 6 18
What is printed when the following code is executed? #include <stdio.h> int main() { for (int i=3, j=5; i>=0; i-=2, j+=j*i) { printf("%d", j); منم }
Consider the following code: int w- 10; while (w>0) scanf("%d", &y); if(y>0){ V++i else The value stored in variable v at the end of the execution of the loop could best be described as the sum of all positive numbers scanned from the terminal the number of times the loop executed the sum of all non-positive numbers scanned from the terminal the number of positive integers scanned from the terminal the number of negative integers scanned from the terminal
Suppose X and Y are independent random variables with Exponential(2) distribution (Section 6.3). We say X ~ Exponential(2) if its pdf is f(x) = -1/2 for x > 0.
Prove that there are no natural number solutions to the equation
where x, y ≥ 2 ... (See Picture Below)
Prove that there are no natural number solutions to the equation where X, Y > 2. x2 - y2 = 1.
5) What is the value of the variable answer after the code segment below completes? int a, b, c; answer, a 3*b: b 5 10: c (a a b*b) / (c*c) answer = A).5 B) 2 C) 2.5 D) 250 ENone of the Above 8) What is the output of the following segment of code? int a 7, b= 3, c = 6 if (a> b c) printf"A"); if (b > a - с) printf ("B"); else printf("C") if (atb...
2. What is the value of x alter the following code is executed # include<iostream> using namespace std; int main int t-0, c- 0,x-3; while (c < 4) t=t+x; cout << x return 0; a) 3 b) 21 c) 24 d) 48 3. What is the output of the following code? # include<iostream> using namespace std; int main0 int a- 3; for (int i 5; i >0; i) a a+i cout << a << “ “ return 0; d) 8...
Assume that the density function for a continuous random variable, Y, is defined as fY(y) = 9y. exp(-3y) for (y>0) and f'(y) = 0 elsewhere. Given Y = y, the conditional C.D.F. for X is FX\Y (x\Y) =P[X 5 X Y = y) = 1 – exp(-x •y) for (x > 0). Questions below are related to the marginal distribution for X. 1. Derive the density, f* (x). 2. Evaluate the expectation, E(X)