• Register
0 votes
46 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
7,520 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

This is an infinite loop.

6 4 2
14,580 points

Related questions

0 votes
1 answer 108 views
108 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, 2020 maddi86 5.4k points
0 votes
1 answer 12 views
12 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.
asked Jan 19 Code Learner 6k points
0 votes
2 answers 36 views
36 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, 2020 maddi86 5.4k points
0 votes
1 answer 161 views
161 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, 2020 maddi86 5.4k points
0 votes
1 answer 26 views
26 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, 2020 ArifulIslam 7.5k points
0 votes
1 answer 62 views
62 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, 2020 ArifulIslam 7.5k points
0 votes
0 answers 34 views
34 views
Problem: Which one of the following would contain the translated Java byte code for a program named Demo? A) Demo.java B) Demo.code C) Demo.class D) Demo.byte
asked Jul 23, 2020 conner 1.5k points
0 votes
1 answer 58 views
58 views
Problem: I am little bit confused and need help regarding my query? Which of the following expressions will determine whether x is less than or equal to y? A) x > y B) x =< y C) x <= y D) x >= y
asked Feb 22, 2020 maddi86 5.4k points
0 votes
1 answer 9 views
9 views
Problem: When creating an application with QUI using the Qt Creator wizard, it creates a class for the window, similar to this: #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = 0); ~ ... the beginning of the class, more accurately Q_OBJECT, What is this? What is it used for or what is it used for?
asked Dec 5, 2020 sasha 13.2k points