In the following pgm add a stmt in the function fun such
that the address of
'a' gets stored in 'j'.
main(){
int * j;
void fun(int **);
fun(&j);
}
void fun(int **k) {
int a =0;
/* add a stmt here*/
}
Answer / susie
Answer :
*k = &a
Explanation:
The argument of the function is a pointer to a pointer.
Is This Answer Correct ? | 1 Yes | 0 No |
Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).
write a program to find out roots of quadratic equation "x=-b+-(b^2-4ac0^-1/2/2a"
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
how to return a multiple value from a function?
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
main() { 41printf("%p",main); }8
How we print the table of 2 using for loop in c programing?
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. –3, -1, 1, 3, 5
main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }
What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }