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
jeka94
3 years ago
10

What will be the value of ans after the following code has been executed?

Computers and Technology
2 answers:
Leno4ka [110]3 years ago
8 0

Answer:

B) 120

Explanation:

In the first three lines of the code, three variables ans, x and y have been declared and initialized;

=> ans = 10;

=> x = 65;

=> y = 55;

On the fourth line and fifth line of the code, there is an if block statement that will get executed if the value of x is greater than or equal to that of y;

i.e

     if (x >= y)

       ans = x + y;

And since x = 65 and y = 55, it implies that x is greater than or equal to y.

Therefore the fifth line of the code will be executed

=> ans = x + y

=> ans = 65 + 55

=> ans = 120

Note:

<em>Though the value of variable </em><em>ans </em><em>was initially 10 before the execution of the if statement, its new value </em><em>120</em><em> will replace the former value.</em>

<em />

Therefore the value of ans after the code has been executed is 120

Lesechka [4]3 years ago
7 0

Answer:

Option B 120

Explanation:

There are three variables,<em> ans, x </em>and <em>y</em> given in the code. In beginning, the variable. <em>ans,</em> holds value of 10.  And variable <em>x</em> and <em>y</em> hold value of 65 and 55, respectively. Since the value held by x is bigger than one held by y, the if condition is met and the statement ans = x + y will run. The execution of this statement will total x with y -> 65 + 55 and the initial value of <em>ans is </em>overwritten by the addition result which is 120.

You might be interested in
Your wearable device synchronized with your smartphone this morning when you turned it on, but the two devices no longer are syn
Lady_Fox [76]
<span>There are several reasons why two devices are not synchronized: maybe there are not the same versions of the programs on both devices, maybe the software needs restart in order to have the latest input data, maybe the internet connection was lost during synchronization

Next steps would be:
- restart the devices
- Update to the latest version
- connect to the internet
- make the synchronization again
</span>
7 0
3 years ago
How can you prevent cyber bullying?
laila [671]
Stay off of social media (mainly instagram or maybe snapchat), put yur account on private mode so you can choose who can follow you.
8 0
3 years ago
Read 2 more answers
Where would you go to add fractions to a document in adobe indesign
prisoha [69]

Just select the fraction text and choose Open Type > Fractions from the Character panel menu.

5 0
3 years ago
Which tool can be used to code basic HTML?<br><br> Text editor<br> JavaScript<br> CSS<br> HTML
luda_lava [24]

Answer:

Java Script

Explanation:

3 0
2 years ago
Read 2 more answers
Ken Olson, president of Digital Equipment Corp. in the late 1970's, Thomas J. Watson, chairman of IBM in the early 1940's, and T
tensa zangetsu [6.8K]

Answer:

All of the above is the correct answer to the given question .

Explanation:

As the Ken olson is the Ken Olson, president of the Digital Equipment Organization . Following are the predictions of  Ken olson of the the technology that are wrong.

  • Lack of creativity regarding the current applications that the user has would consider for the  technology.
  • Lack of creativity regarding the  user or the client has liking.
  • Lack of creativity on what the government would be charging ford. Any of these

So we will choose the Option all these.

8 0
3 years ago
Other questions:
  • )How to extract a specific element of item in a list?
    13·1 answer
  • 1.
    13·1 answer
  • Which of the following can be created when two tables contain a common field?
    14·1 answer
  • Which type of computer operating system would be best for a large corporation?
    7·2 answers
  • Select the Navy Admiral who invented a high-level programming language FLOW-MATIC in 1953.
    7·1 answer
  • Create a Python program that: Allows the user to enter a person's first name and last name. The user should be able to enter as
    12·1 answer
  • .Choose the extention of Scratch Project<br><br><br> .sb2<br><br> jpeg<br><br> .exls
    5·2 answers
  • When you start a new blank document, you begin typing at the
    6·1 answer
  • 7. Type the correct answer in the box. Spell all words correctly.
    8·1 answer
  • What three best practices can help defend against social engineering attacks?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!