# What will be the value of x after the following code is executed?

190 views

## Problem:

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.

## Solution:

This is an infinite loop.

## Related questions

197 views
Problems: What will be the value of x after the following code is executed? int x, y = 4, z = 6; x = (y++) * (++z); A) 24 B) 28 C) 30 D) 35 I am new to programming , Can anyone help me ?
39 views
Problem: Hello programmers! I want to know how many times will the following loop be executed? for(int i = 0; i<= 100; i = i+2) Moreover, what will be the value of &lsquo;i&rsquo; when this loop terminates? I am a beginner so I am so confused.
42 views
Problems: I am new to programming, I need help, can anyone help me? What would be the value of discountRate after the following statements are executed? double discountRate = 0.0; int purchase = 1250; char cust = 'N'; if (purchase > 1000) if (cust == 'Y') discountRate = .05; else ... (cust == 'Y') discountRate = .04; else discountRate = .03; else discountRate = 0; a) .04 b) .03 c) .05 d) 0
9 views
Problem: Is anyone available to assist me and resolve this issue? What will be the values of x and y as a result of the following code? int x = 12, y = 5; x += y--;
237 views
Problem: I am new in programming and when running below code getting some unexpected error, can anyone help me with right result after running this code? Given the following code, what will be the value of finalAmount when it is displayed? public class Order { ... getOrderAmount() - order.getOrderAmount() * order.getOrderDisc(); System.out.println("Final order amount = \$" + finalAmount); } }
31 views
Problem: Which of the following commands set &ldquo;other&rdquo; permissions on file to r-x? chmod o-r-w file chmod o+rx file chmod o=rx file chmod o=r+x file