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.
Answer:
If we are talking about government then they are smart bc of there two house policies, both are equal yet super unique. They make sure each state has an equal voice in the senate.
Answer:
Malware is designed to cause damage to a stand alone computer or a networked pc. So wherever a malware term is used it means a program which is designed to damage your computer it may be a virus, worm or Trojan.
Explanation:
Answer:
what is typing race
this link can not be clicked
When numbers are divided, the integer portion is kept and the remainder is disregarded (meaning 10/9 would return 1). Following this format, we get the answer of <span>6 6 6 3 7 7 9 5 8 8.
I also see that this program can be optimized because you use the same for loop twice, and both of them manipulate list elements in some way. A more optimized program would be:
</span><span>int a [] = {64 , 66 , 67 , 37 , 73 , 70 , 95 , 52 , 81 , 82};
for (int i = 0; i < a.length; i++) {
a[i] = a[i] / 10;
</span>System.out.print(a[i] + " ");<span>
}
Or maybe you don't need to store the list values for later on. You could do:
</span>for (int i = 0; i < a.length; i++) {
System.out.print(a[i] / 10 + " ");
}
In any situation, your answer is choice 2.