1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sertanlavr [38]
3 years ago
14

What will be the value of x after the following code is executed? int x = 10; do { x *= 20; } while (x < 5); A. 10 B. 200 C.

This is an infinite loop. D. The loop will not be executed, the initial value of x > 5.
Computers and Technology
2 answers:
dezoksy [38]3 years ago
6 0

Answer:

Option B is the correct answer.

Explanation:

  • In the above code, the loop will execute only one time because the loop condition is false and it is the Do-While loop and the property of the Do-while loop is to execute on a single time if the loop condition is false.
  • Then the statement "x*=20;" will execute one and gives the result 200 for x variable because this statement means "x=x*20".
  • SO the 200 is the answer for the X variable which is described above and it is stated from option B. Hence it is the correct option while the other is not because--
  1. Option A states that the value is 10 but the value is 200.
  2. Option C states that this is an infinite loop but the loop is executed one time.
  3. Option D states that the loop will not be executed but the loop is executed one time
Juliette [100K]3 years ago
4 0
It’s B.200 it’s answer for x value
You might be interested in
How do we explain the difference between fake news and facts​
Natalija [7]

Answer: it depends if the news is on the news and someone rights an article about it and says some mislead details that's how u know its fake  

Explanation:

3 0
3 years ago
Write a program in c or c++ to perform different arithmeticoperation using switch statement .the program will take two inputinte
baherus [9]

Answer:

C code :

#include<stdio.h>

int main()

{

int j;

float k,l, x;  //taking float to give the real results.

printf("Enter your two operands: ");  //entering the numbers on which      //the operation to be performed.

scanf("%f %f", &k, &l);

 

printf("\n Now enter the operation you want to do: ");

printf("1 for Addition, 2 for Subtraction, 3 for Multiplication, 4 for Division ");

scanf("%d", &j);  //j takes the input for opearation.

 

switch(j)  

{

 case 1:  

  x=k+l;

  printf("%.2f+%.2f=%.2f",k,l,x);   //we write %.2f to get the result //upto 2 decimal point.

  break;

   

 case 2:

  x=k-l;

  printf("%.2f-%.2f=%.2f",k,l,x);

  break;

 case 3:

  x=k*l;

  printf("%.2f*%.2f=%.2f",k,l,x);

  break;

 case 4:

  if(l!=0) //division is not possible if the denominator is 0.

  {

   x=k/l;

   printf("%.2f/%.2f=%.2f",k,l,x);

  }

  else  

   printf("Division result is undefined");

               default:

   printf("\n invalid operation");

}

}

Output is in image.

Explanation:

At first we take two numbers.

Then we take integers from 1 to 4 for Addition, subtraction, multiplication, division respectively.

Then accordingly the case is followed and the operation is performed.

6 0
3 years ago
Tanner is creating a brochure for his Web-hosting company. He designed the layout and placed a picture in the center of the page
Romashka [77]
Resizing is a very simple process. On the photo editing program, simply click on the image, and if resize handles appear around it, click and drag those to the desired size. If the program has a dedicated resizing or rescaling tool, use it and follow the above instructions. Keep the photo proportionate by holding down the shift key while dragging a corner handle. <span>Tanner has to make sure that his photo his of a high enough resolution to resize. A pixellated or blurry photo will only get worse when scaled up. He also has to make sure he doesn't resize it to be too big or it will also end up pixellated.</span>
5 0
3 years ago
Python is an example of a low level programming language true or false?​
alekssr [168]
False- python is an example of a high level language. Other high levels are c++, PHP, and Java
6 0
2 years ago
Who is the father of modern computer?​
nydimaria [60]

Answer:

I would say Alan Turing is the father of the modern computer

7 0
3 years ago
Read 2 more answers
Other questions:
  • ¿Cuál es el objetivo principal de los servicios?
    7·1 answer
  • What is a browser cookie?
    10·2 answers
  • you just finished creating an expense report table, but your boss tells you to create an extra column representing non-productio
    5·1 answer
  • Write a program in Python that reads in investment amount, annual interest rate, and number of years, and displays the future in
    6·1 answer
  • Which type of error is a random error
    13·2 answers
  • Which of the following statements is TRUE?
    11·1 answer
  • Explain what happens if you try to open a file for reading that does not exist.
    10·1 answer
  • PLS HELP SOON
    15·1 answer
  • What if you accidentally delete your browser history
    7·1 answer
  • Convert the following binary to decimal number . <br>a). 101101 ​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!