Correct answer is option 1 i.e., 0
x will be assigned with the comparison operation value of a>=b.
a has been initialized as 45 and b has been initialized as 92.
Hence, the operation a>=b returns 0 (since it is false). (It returns 1 if it is true).
Therefore, x will be assigned with 0.
What value does the variable x hold after the following has executed? int x=5, a -45,...
1. What will be the value of x after the following code is executed? int x = 10, y = 20; while (y < 100) { x += y; } A. 90 B. 110 C. 210 D. This is an infinite loop 2. If a superclass has constructor(s): A. then its subclass must initialize the superclass fields (attributes). B. then its subclass must call one of the constructors that the superclass does have. C. then its subclass does not inherit...
What will be the value of x after the following code is executed? int x = 5; while (x <50) { x += 5; } a) 50 b) 45 c) Infiniteloop d) 55 Given the following code segment: Scanner in = new Scanner (System.in); boolean done = false; while (!done) { int input = in.next(); if(input.equalsIgnoreCase("q")) done = false; } What will cause the loop to terminate? a) When the user enters -1 b) The loop will never terminate c)...
What is the value of y after the following code is executed? int x = 20, y = 30; do { int z; z = 3 * ( y
Question 16 What is the value of x after the following code is executed? X = 7 If x < 7 X = x + 1 X = x + 2 7 9 10 8
java by the way What is the value of the variable y after the following code is executed? int x = 10; int y = 0; while (x > 0) { x = x / 2; y++; } 4 3 2 1
Question 1 What is the value of x after the following int x = 5; x++; x++; x+=x++; A)14 B)10 C)13 D)15 Question 2 The last line in value returning function (before the }) should contain the word return. True False Question 3 This contains three parts: Void or Data Type the name optional parameter list A)Menu System B)Function Header C)Switch Question 4 What is a variable? A)a pointer B)a place in memory to hold data C)int D)a computer programming...
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...
6) What is the final value of variable num after executing the following statements? void Exam(int & N) A)13 ( T++ ¢ut << < 1 ) B)12 void main() (int num-10; C) 11 for (int i - 0; i < 3; i.) Exam (num). D) 10
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); منم }
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...