• Register
0 votes
20 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.

5 3 2
5,650 points

1 Answer

0 votes

Solution:

This is an infinite loop.

5 3 1
10,860 points

Related questions

0 votes
1 answer 53 views
53 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 ?
asked Feb 13 maddi86 5.4k points
0 votes
2 answers 31 views
31 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
asked Feb 14 maddi86 5.4k points
0 votes
1 answer 107 views
107 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); } }
asked Feb 18 maddi86 5.4k points
0 votes
1 answer 17 views
17 views
Problem: Which of the following is NOT a rule that must be followed when naming identifiers? A. Identifiers for constants should use an underscore between words. B. Identifiers should use periods to separate words. C. Identifiers should list the data type at the end of the name. D. Identifiers can contain spaces.
asked Mar 9 ArifulIslam 5.7k points
0 votes
1 answer 16 views
16 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
asked Jul 23 ArifulIslam 5.7k points