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
Mirrors on cars exist to____.
TEA [102]

Answer:

c is ur answer

Explanation:

7 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell the words correctly.
ExtremeBDS [4]

Answer:

The IT field yeah am sure

7 0
3 years ago
Which sns gets its names from one of its unique features
Komok [63]

Answer:

no

Explanation:

3 0
2 years ago
The CEO of CorpNet.xyz has hired your firm to obtain some passwords for their company. A senior IT network administrator, Oliver
MA_775_DIABLO [31]

Answer:

The olennon account's password: See the attached file for this.

The Administrator account's password: 4Lm87Qde

Explanation:

Note: See the attached excel file for the olennon account's password as I was unable to save it here because I was instead getting the following message:

"Oh no! It seems that your answer contains swearwords. You can't add it!"

The olennon account's password and the Administrator account's password can be found as follows:

To see the rear of the computer, click Back from the menu bar above the computer.

Drag the USB Type A connector for the keyboard from the rear of the computer to another USB port on the machine.

Make sure the keyboard is plugged back in.

Expand System Cases on the shelf.

Add the Laptop to the Workspace by dragging it there.

To see the rear of the laptop, click Back from the menu above the laptop.

Drag the keylogger from the computer to the laptop's USB port.

Select Front from the menu above the laptop to see the front of the laptop.

Select Click to display Windows 10 on the laptop.

Toggle between keylogger and flash drive mode by pressing S + B + K.

To control what occurs with detachable drives, select Tap.

To view files, choose Open folder.

To open the file, double-click LOG.txt.

Select Answer Questions in the top right corner.

Respond to the questions.

Choose Score Lab as the option.

Therefore, we have:

The olennon account's password:

The Administrator account's password: 4Lm87Qde

Download docx
7 0
3 years ago
In the application development area, ____________ often refers to bringing together various sources of data to create a new prod
Vinvika [58]

Answer:

mashup

Explanation:

In the application development area, mashup often refers to bringing together various sources of data to create a new product with unique value.

8 0
2 years ago
Other questions:
  • What must you do first in order to change the font type size and colour of a particular text
    13·2 answers
  • ​A(n) ____ will hold an online auction buyer’s payment until he or she is satisfied that the item bought matches the seller’s de
    13·1 answer
  • Write a SELECT statement that selects all of the columns for the catalog view that returns information about foreign keys. How m
    6·1 answer
  • Multiple arrays. Jump to level 1 For any element in keysList with a value greater than 40, print the corresponding value in item
    7·2 answers
  • What is "the last mile of broadband access"? Why is this a problem and what kind of impact does it have on the business world an
    9·1 answer
  • How many questions have you seen so far other than this one?
    10·2 answers
  • . Which responsibility belongs to the marketing function?
    11·1 answer
  • Chris needs to modify the default bullets that are used in a nonnumbered list in Word.
    12·2 answers
  • Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the cou
    13·1 answer
  • Four examples of computer virus​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!