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
Ainat [17]
3 years ago
10

In class, we discussed static local variables in C. Answereach question below; if necessary, find and consult a reference on the

C language (cite your source in your answer).
(a) For a non-static local variable in a C function, what is its scopeand what is its lifetime?
(b) For a static local variable in a C function, what is its scope andwhat is its lifetime?
(c) For a non-static global variable in C, what is its scope and whatis its lifetime?
(d) For a static global variable in C, what is its scope and what is itslifetime?
Computers and Technology
1 answer:
alexira [117]3 years ago
6 0

Answer:

(a) scope: function, lifetime: duration of the function

(b) scope: function, lifetime: duration of the program

(c) scope: global (all modules),  lifetime: duration of the program

(d) scope: module (file), lifetime: duration of the program

You might be interested in
Meaning of fetch cycle​
kherson [118]

Answer:

The instruction cycle (also known as the fetch–decode–execute cycle, or simply the fetch-execute cycle) is the cycle that the central processing unit (CPU) follows from boot-up until the computer has shut down in order to process instructions.

Explanation:

7 0
3 years ago
In order to print multiple worksheets, what needs to happen before printing?
ryzh [129]

Answer:

Explanation:

Click the File tab.

Click Print, or press the control p keyboard command.

On the Print screen, select the printer and other settings.

Click Print.

7 0
3 years ago
Which is a major drawback of muliuser procesing of a database
-BARSIC- [3]

The main drawback of multiuser processing of a database is:

  • Lost-update problem.

<h3>What is  lost-update problem?</h3>

In the area of lost update problem, an update that has been carried on to a data item by a transaction is said to be lost as it is known to be overwritten by the update that has been carried on by another transaction.

Therefore, The main drawback of multiuser processing of a database is:

  • Lost-update problem.

Learn more about database from

brainly.com/question/26096799

#SPJ12

3 0
2 years ago
Write a Python program called wdcount.py which uses a dictionary to count the number of occurrences of each word (ignoring case)
Art [367]

The program is an illustration of loops.

<h3>What are loops?</h3>

Loops are program statements used to perform repetition

<h3>The wordcount.py program</h3>

The program written in Python, where comments are used to explain each line is as follows

# This opens the file in read mode

text = open("myFile.txt", "r")

# This creates an empty dictionary

d = dict()

#This iterates through the text

for line in text:

# This splits the line into words, after removing leading & trailing spaces, and newline characters

words = line.strip().lower().split(" ")

# This iterates through all the words

for word in words:

 # The following if condition counts the occurrence of each word

 if word in d:

  d[word] = d[word] + 1

 else:

  d[word] = 1

#This prints the words and their frequencies, in descending order

for w in sorted(d, key=d.get, reverse=True):

   print(w, d[w])

Read more about loops at:

brainly.com/question/16397886

5 0
2 years ago
The Pentium 4 Prescott processor, released in 2004, has a clock rate of 3.6 GHz and voltage of 1.25 V. Assume that, on average,
Zarrin [17]

Answer:

a) C = 3.2 x 10^-8 F, C = 2.9 x 10^-8 F

b) 10%, 42.86%, 0.11, 0.75

c) 0.849 volts to maintain the same leakage current in the Pentium 4 Prescott Processor. 0.783 Volts to maintain the same leakage current in the Core i5 Ivy Bridge Processor.

Explanation:

<u>For the Pentium 4 Prescott processor:</u>

Clock rate (f) = 3.6 GHz

Voltage (V) = 1.25 V

Static Power Consumption = 10 W

Dynamic Power Consumption = 90 W

<u>For the Core i5 Ivy Bridge processor:</u>

Clock rate (f) = 3.4 GHz

Voltage (V) = 0.9 V

Static Power Consumption (SP) = 30 W

Dynamic Power Consumption (DP) = 40 W

(a) To find the average capacitive loads, use the formula:

DP = (1/2) x C x V² x f

Rearranging:

C = (2 x DP)/(V² x f)

For the Pentium 4 Prescott processor:

C = (2 x 90) / [(1.25)² x 3.6 x 10^9]

C = 3.2 x 10^-8 F

For the Core i5 Ivy Bridge processor:

C = (2 x 40) / [(0.9)² x 3.4 x 10^9]

C = 2.9 x 10^-8 F

(b) Percentage of the total dissipated power comprised by the static power can  be found by the formula:

<u>[Static Power/(Static Power + Dynamic Power)] x 100</u>

For the Pentium 4 Prescott Processor:

[10/(90+10)] x 100  = 10%

For the Core i5 Ivy Bridge Processor:

[30/30+40] x 100 = 42.86 %

Ratio of static power to dynamic power for each technology can be computed as:

Pentium 4 Prescott: 10/90 = 0.11

Core i5 Ivy Bridge: 30/40 = 0.75

(c) The total dissipated power can be calculated by:

P = DP + SP

For Static Power we have the formula:

SP = VI where I is the leakage current.

I = SP/V

For Pentium 4 Prescott: I = 10/1.25 = 8A

For Core i5 Ivy Bridge: I = 30/0.9 = 3.33 A

The total disspited power is reduced by 10%, meaning the ratio of new power to old power must be 90% = 0.9. So,

New Power/Old Power = 0.9

For Pentium 4 Prescott:

DP + SP / 100 = 0.9

VI + CV²F = 0.9 x 100

V(8) + (3.2 x 10^-8)V²(3.6 x 10^9) = 90

8V + 115.2V² - 90 = 0

By solving the quadratic equation, we get the positive answer as 0.849. This means that the voltage should be reduced to 0.849 volts to maintain the same leakage current in the Pentium 4 Prescott Processor.

For Core i5 Ivy Bridge:

DP + SP / 70 = 0.9

V(3.33) + (2.9 x 10^-8)V²(3.4 x 10^9) = 70 x 0.9

3.33V +98.6V² -63 = 0

By solving the quadratic equation we get the positive answer as 0.783. This means that the voltage should be reduced to 0.783 Volts to maintain the same leakage current in the Core i5 Ivy Bridge Processor.

6 0
4 years ago
Other questions:
  • What is FireWire?
    7·2 answers
  • How do ethics affect people?
    15·1 answer
  • Richard needs to copy information from another slide presentation that uses a different design template. To ensure that the info
    7·1 answer
  • How do you change the order of the slides in your presentation in the slide pane 
    15·2 answers
  • A record is a specific piece of information state true or false​
    12·1 answer
  • Political parties to address the interest of civil society<br>​
    7·1 answer
  • Choose the correct term to complete the sentence.
    10·1 answer
  • A CPU has just been powered on and it immediately executes a machine code instruction. What is the most likely type of instructi
    13·1 answer
  • Why is it important to prepare the farm resources before you start working? explain​
    14·1 answer
  • What type of purchase requisition is used to turn-in a recoverable/reparable material to the ssa?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!