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
Assume that you have an array of integers named arr. Which of these code segments print the same results?
tresset_1 [31]

Answer:

II and III only

Explanation:

In Code segment II, the output of the array will be started form arr[0] and ends at the arr[length]. Because loop starts from 0 and ends at length of array. This will print the full array data.

In code segment III, the output will be all values of array as loop starts form first index and ends at last index.

On the other hand I code segment prints all array values except last value of the array. As the loop shows that, it will terminate at second last value of the array.

4 0
2 years ago
A picture drawn in 3 d is called?​
Varvara68 [4.7K]

Answer:

autostereogram

Explanation:

that^

6 0
3 years ago
Read 2 more answers
Can we declare top level classes as private or protected?
uysha [10]

Answer and Explanation:

top level class can not be declare as private or protected. It is always public. If we declare a top level class as private then the compiler always complain that the  private is not allowed  and if we declare top level class as protected then compiler complain that modifier protection is not allowed here. so we can not declare top level class as private or protected

5 0
3 years ago
Francis has designed a picture book appropriate for third graders. He wants teachers across the world to freely download use, an
mestny [16]

Answer:

The correct answer will be "Project Gutenberg".

Explanation:

  • Project Gutenberg continues to obtain lots of requests for authorization for using printed books, pictures, as well as derivatives from eBooks. Perhaps some applications should not be produced, because authorization would be included in the objects provided (as well as for professional usages).
  • You can copy, hand it over, or m actually-use it underneath the provisions including its license that was included in the ebook.

So that the above is the right answer.

8 0
2 years ago
True or false for a given set of input values, a nand
Katen [24]
Nand stands for "not and". The truth table for a nand is:

a b | a nand b
0 0 |      1
0 1 |      1
1 0 |      1
1 1 |      0

Hopefully this helps you answer your question.
6 0
2 years ago
Other questions:
  • You browsing internet and you realize that its not responding what do you do with out rebooting the computer
    10·1 answer
  • Dams provide what kind of energy ?
    5·2 answers
  • Which option allows you to customize the order of your data ?
    8·2 answers
  • In which job role would a course in 3D modeling help with professional career prospects?
    9·2 answers
  • When you collaborate or meet with a person or group online, it is called
    12·2 answers
  • Design a hierarchy c hart or flowchart for a program that calculates the current balance in a savin gs account. The program must
    8·1 answer
  • As a general rule, what is the size of a brochure?
    11·1 answer
  • Resize vector countDown to have newSize elements. Populate the vector with integers {newSize, newSize - 1, ..., 1}. Ex: If newSi
    6·1 answer
  • A computer program that enables users to create and work with files and folders is called what?
    8·2 answers
  • What type of software is an antivirus?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!