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
pav-90 [236]
3 years ago
12

Write the half function. A function call and the functionprototype

Computers and Technology
1 answer:
EastWind [94]3 years ago
3 0

Answer:

C code for half()

#include<stdio.h>

void half(float *pv);

int main()

{

float value=5.0;  //value is initialized  

printf ("Value before half: %4.1f\n", value); // Prints 5.0

half(&value);  // the function call takes the address of the variable.

printf("Value after half: %4.1f\n", value); // Prints 2.5

}

void half(float *pv) //In function definition pointer pv will hold the address of variable passed.

{

*pv=*pv/2;  //pointer value is accessed through * operator.

}

  • This method is called call-by-reference method.
  • Here when we call a function, we pass the address of the variable instead of passing the value of the variable.
  • The address of “value” is passed from the “half” function within main(), then in called “half” function we store the address in float pointer ‘pv.’ Now inside the half(),  we can manipulate the value pointed by pointer ‘pv’. That will reflect in the main().
  • Inside half() we write *pv=*pv/2, which means the value of variable pointed by ‘pv’ will be the half of its value, so after returning from half function value of variable “value” inside main will be 2.5.

Output:

Output is given as image.

You might be interested in
Identify and discuss the seven layers of the Open System Interconnection (OSI) model and their importance on TCP/IP operation.
a_sh-v [17]

Answer:

following are the OSI Layers

1.physical layer

2.datalink layer

3.network layer

4.transport layer

5.session layer

6.presentation layer

7.application layer

Explanation:

physical layer is used to transmit media,signal and binary information

datalink layer is used for physical addressing MAC and LLC

network layer is used for path determination and ip

transport layer is for end to end communication and reliability

session layer is for interhost communication

presentation layer is for data representation and encryption

application layer is network process to application

4 0
3 years ago
You use the Paste Options button labeled ____ if you want the pasted chart not to be linked to the source document and you want
Semenov [28]

Answer:

Keep Source Formatting & Embed Workbook

Explanation:

Source formatting is used to apply the formatting from source document while copying and pasting.

Source is the place where the data is already placed and we want to move it make a copy of it on some other document. So if we don't want to change the formatting of source document, we choose source formatting from the options while pasting.

Embed is used to whenever we don't want to link the formatting with source document.

So,

You use the Paste Options button labeled <u><em>Keep Source Formatting & Embed Workbook</em></u><em> </em>if you want the pasted chart not to be linked to the source document and you want the pasted chart to keep the formatting from the source document.

8 0
3 years ago
Read 2 more answers
Rob used Track Changes to suggest changes in Jack's document. Jack agrees with some edits and disagrees with others. What should
Kamila [148]

Answer:

B.   Click the Next icon on the Reviewing toolbar to review and then accept or reject each edit.

Explanation:

Since Jack wants to keep some changes and reject others, he can't use  a global solution (like presented in answers A and C).

He has to go through each and every change proposition and decide individually if he wants to keep the change or not.  That's why it's answer B.

It's the only way to accept some, reject some.  

At the end of this process, he'll have a clean document with Rob's recommendations and his original documents.

3 0
3 years ago
You have just performed a cpm analysis and have found that more than one path through the project network has zero slack values.
Alex787 [66]

Answer:

There are multiple critical paths

Explanation:

The critical path method (CPM), or critical path analysis (CPA), is an algorithm for scheduling a set of project activities. It is commonly used in conjunction with the program evaluation and review technique (PERT). A critical path is determined by identifying the longest stretch of dependent activities and measuring the time required to complete them from start to finish.

The essential technique for using CPM is to construct a model of the project that includes the following:

  •    A list of all activities required to complete the project (typically categorized within a work breakdown structure),
  •    The time (duration) that each activity will take to complete,
  •    The dependencies between the activities and,
  •    Logical end points such as milestones or deliverable items.      

Using these values, CPM calculates the longest path of planned activities to logical end points or to the end of the project, and the earliest and latest that each activity can start and finish without making the project longer. This process determines which activities are "critical" (i.e., on the longest path) and which have "total float" (i.e., can be delayed without making the project longer).

considering the above function of the cpm analysis because you have multiple path, there is tendency that more than path through the project network will have zero slack values.

5 0
3 years ago
Help me help you............
KiRa [710]

Answer:

change how big or small the shape or sprite is

6 0
1 year ago
Other questions:
  • To determine what to study, one should first
    8·1 answer
  • A server would experience a __________ attack when a hacker compromises it to acquire information from it from a remote location
    13·1 answer
  • What is the output of the second println statement in the main method, public class foo { int i ; static int s ; public sttic vo
    15·1 answer
  • Andy is trying to put together a holiday gift knapsack (with W=8) for Sarah. He has n items to choose from, each with infinitely
    15·1 answer
  • How does a linear algorithm perform compared to a quadratic one on our imaginary race track?
    5·1 answer
  • A national tax preparation firm is accessing industry-specific productivity applications in the cloud; many other tax preparatio
    13·1 answer
  • Strobe lights can become more yellow as they age true or false
    8·1 answer
  • ______ are used to store all the data in a database.
    7·1 answer
  • The illustration shows different types of text language.
    5·2 answers
  • Which of the phases of the software development life cycle (SDLC) would the following action take place in?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!