Answer:
The correct answer for the given question is option(A) i.e Global
Explanation:
The global variable is the variable which is declared outside the function The lifetime and scope of global variable in whole the program i.e "Globally" .They can be access anywhere in the program,however local variable are those which is declared inside the function .local variable are access inside that function only where it is declared.
Following are the example of Global variable.
#include <stdio.h> // header file
int t=9;// global variable declared outside the function
int main() // main function()
{
printf("%d",t); // display the value of t
return 0;
}
so the correct answer is Global.
Explanation:
To understand how this program is working let us print the variable value at different stages of the program so that we can understand how it is working.
Intitally, value=10 when it was declared.
Then we added 5 and it become value=15
then we used fork() function which creates a parent(orignal) and child(duplicate)
When fork() succeeds it returns the child pid to parent and returns 0 to the child. As you can see (pid > 0) condition is always true therefore the parent pid value becomes 35 ( 15+20) and the child pid value becomes 0.
#include <stdio.h>
#include <unistd.h>
int main( ) {
int value = 10;
printf("%d\n",value);
int pid;
value += 5;
printf("%d\n",value);
pid = fork( );
printf("%d\n",pid);
if (pid > 0 )
{
value += 20;
}
printf("%d\n",value);
return 0;
}
Output:
10 (initial value)
15 (modified value)
5343 (pid when fork is used)
35 (final modified value)
0 (child value)
15 (the parent value when fork was used)
The answer is B I did the test
Answer:
When that information gets posted online, it is no longer private, and may end up falling into wrong hands. Even if you have put in place the highest possible security measures, some of your friends, colleagues and companies you interact with on social media, can end up leaking your personal information.
Answer:
Multiples of 5 are 5, 10, 15, 20, 25,...