1) What will be the value of x after the following code is executed? int x = 10; while (x < 100); { x += 10; } A) 90 B)

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1) What will be the value of x after the following code is executed? int x = 10; while (x < 100); { x += 10; } A) 90 B)

Post by answerhappygod »

1) What will be the value of x after the following code is
executed?
int x = 10;
while (x < 100);
{
x += 10;
}
A) 90
B) 100
C) 110
D) This is an infinite loop.
1) What will be the value of x after the following code is
executed?
int x = 10;
while (x < 100);
{
x += 10;
}
A) 90
B) 100
C) 110
D) This is an infinite loop.
2) What will be the value of x after the following code is
executed?
int x = 10, y = 20;
while (y < 100)
{
x += y;
y += 20;
}
A) 90
B) 110
C) 130
D) 210
I know the answers but I need an explanation,
please..................
1)D
2)D
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply