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
Mice21 [21]
3 years ago
11

The scope of a variable declared outside of any function is:

Computers and Technology
1 answer:
Marta_Voda [28]3 years ago
5 0

Answer:

a) Global

Explanation:

The scope of a variable declared outside of any function is Global.

Let us consider an example:

int g;

int  add(int a,int b){

   return a+b;

}

int  subtract(int a,int b){

   return a-b;

}

Here the variable g is defined outside any function and is accessible anywhere within the program. This is a global variable.

Variables defined within each function - a,b on the other hand have a local scope are are visible only within their respective function bodies.

You might be interested in
Answer the following questions:
victus00 [196]

Answer:

The answer to the following questions can be given as:

Question: 1

value of foo is = 1020

Question: 2

Output of the code is = false

Question: 3

function add(a, b)

{

 return a && b ? a + b : function (c) { return a + c; };

}

var a=add(2,5);

var x=add(2)(5);

print(a);

print(x);

output:  

7

7

Question: 4

"goh angasal a m'i"

Question: 5

In this we check that if in the window a foo function exists. otherwise we set windows.foo to bar.

Question: 6

first alert shows the value "Hello World";

second alert shows value ReferenceError, In this bar not defined.

Question: 7

The value of foo.length is  2

Question: 8

The value of foo.x is undefined

Question: 9

Function print = "one", "three", "two" .

Question :10

It is difficult to define because doSomethingElse() function is not defined.

Explanation:

In question 1 the value of the foo variable is 1020 because we perform the string concat operation.

In question 2 Output of the code is false because float value keeps in binary and when we convert 0.1 or 0.2 to binary so it is not the same.

In question 3 the output of both functions is 7.

In question 4 the output is goh angasal a m'i because In this code we use the reverse() function, split() function and join() function. Reverse function reverses the value. split function splits the value and join function join all the value of the string in a line.

In question 5 we check the value.

In question 6, the first output is Hello World and second is ReferenceError.

In question 7, the value of foo.length is 2 because this foo array we insert only 2 values.

In question 8, the value of foo.x is undefined because in the variable we reset the value of foo all together, so foo.x value is undefined.

In the question 9 function print "one",  

"three",  

"two" because In the function first, we print the message that is "one" then we define a function in this function we print the value  

"two" but before creating object we call the "three" so the print value is "one",  

"three",  

"two".

In question 10 function, the output of this function is undefined.

3 0
3 years ago
I need help with Python. The first image is the code and the 2nd is the output.
Gekata [30.6K]
The issue arises because the string you are trying to print is not a string, rather a float value. Item1, item2 and item3 are strong values (if you type some alphabets in it and not just numbers), but itemonecost, itemtwocost, and itemthreecost are explicitly type casted to float. In line 22, 23, and 24 you’re trying to print a float, by adding it with the string. One cannot add numbers to string. Rather you can type cast the itemcost to string while printing.

Add str(itemonecost) instead of itemonecost in print statement. Do this for other float variables too.

However do note that there are multiple ways to correct this issue, and I’ve just pointed one out.
4 0
3 years ago
The word software is interchangeable with what word
defon
It could be interchangeable with the word program
4 0
2 years ago
Two functions of the UPS​
Angelina_Jolie [31]

Answer:

UPS is abbreviation of Uninterrupted power supply. It is a battery backup devices useful when major supply is interrupted due to any reason.

It performs the following functions:

1. It provides protection from power surges.

2. Smooth out noisy power sources

5 0
3 years ago
Read 2 more answers
What type of object can offer the most effective way to display data and calculations in a presentation?
poizon [28]

This is definitely an opinion, but an excel you can do A and D and just about the same as B also

<u>So i'd say C </u>

8 0
2 years ago
Other questions:
  • What can you do to make sure you have a healthy credit report
    13·2 answers
  • You're an administrator for a large corporation and you are responsible for deploying computers often and quickly. What server d
    10·1 answer
  • A specially formatted encrypted message that validates the information the CA requires to issue a digital certificate is known a
    6·1 answer
  • Which process centers the spreadsheet's content on the page?
    15·1 answer
  • Assume that you have an ArrayList variable named a containing 4 elements, and an object named element that is the correct type t
    9·1 answer
  • According to the stage-gate process developed by Robert G. Cooper, _____ are the results of the previous stage and are the input
    15·1 answer
  • it says i have brainly plus subscripton but whenever i log onto brainly using my laptop, it says i don't have brainly plus and w
    12·1 answer
  • Shane is working on a new project for the sales department. The company wants a way to allow the sales force to print orders at
    5·1 answer
  • Kylee needs to ensure that if a particular client sends her an email while she is on vacation, the email is forwarded to a cowor
    7·1 answer
  • Choose all of the items that represent functions of an operating system.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!