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
When a single controller device communicates with multiple peripheral devices, what wires are simultaneously connected to all de
Tems11 [23]

The wires that are simultaneously connected to all devices in the network are;

SDA(Serial data line) and SCL

Integrated Circuits Communication

This involves I²C which is a form of communication based on integrated circuits.

Now, this I²C is a serial communication interface that has a bidirectional two-wire synchronous serial bus which usually comprises of two wires namely SDA (Serial data line) and SCL (Serial clock line).

Read more about integrated circuits communication at; brainly.com/question/26153031

7 0
2 years ago
Which of the following is NOT a common grammar adjustment which is identified by grammar-check software?
Sedbober [7]

Answer:

Shortened versions of phrases Ex:(l ol, s mh, i dk, ect.)

Explanation:

Hope that this helps, if you have any more question please feel free to contact me, hope you have an amazing rest of your day. ;D

7 0
2 years ago
Once you fix the bug in a code, what is the last thing you should do?
aleksklad [387]

Answer:

Know what the code should do

4 0
3 years ago
How long does it take 2 consultants to create a slide deck of 120 slides, assuming one consultant make 2 slides per hour?
Andreyy89

It would take 2 consultants 30 hours to create a slide deck of 120 slides.

Explanation:

Rate of slide making by one consultant- 2 slides per hour

Target- 120 slides

2 consultants are employed in the job-  

Since 2 consultants are employed in the job, total rate of making slides per hour would be 4 slides/hour (2*2 slides/hour)

Time required to complete 120 slides= total slides/rate of doing slides per hour

Substituting the values, we get

Time required= 120/4= 30 hours

Hence, it would take 30 hours for 2 consultants to create a slide deck of 120 slides.

7 0
3 years ago
You have just installed the microsoft windows 7 operating system on your pc. which web browser is bundled with windows 7 and is
kirill [66]
The web browser that is automatically installed with windows 7 is Internet Explorer.

Hope this helps.
6 0
3 years ago
Other questions:
  • A document repository is down when you attempt to access it. which isa principle is being violated?
    13·1 answer
  • An example of what you can post that shows kindness to other
    15·1 answer
  • What are the basic tools for coding HTML manually?
    10·2 answers
  • 1. Problem solving is
    13·1 answer
  • Write a function chat accepts a pointer to a C-string as its argument. The function should count the number of vowels appearing
    5·1 answer
  • I don't understand how to write code for this in Java using nested for loops only. The official question is: write a program tha
    8·1 answer
  • In the view that follows, which field can't be updated create view example_2 as select invoice_number, invoice_date, invoice_tot
    13·1 answer
  • You have the templates of 2 classes, Person and Program. The Person class has 4 attributes, name, age, major and gpa. There is a
    7·1 answer
  • Write programs in python to display “Valid Voter”. (condition : age of person should be
    15·1 answer
  • 11 Select the correct answer. Which external element groups items in a design?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!