ExamVeda
Login
Home
51
Suppose we have a one dimensional array, named 'x', which contains 10 integers. Which of the following is the correct way to allocate memory dynamically to the array 'x' using malloc()?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
52
Queue data structure works on the principle of . . . . . . . .
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
53
Which of the following is an example of static memory allocation?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
54
What will be the output of the following C code? (Given that the size of array is 4 and new size of array is 5)
#include<stdio.h>
#include<stdlib.h>
main()
{
    int *p,i,a,b;
    printf("Enter size of array");
    scanf("%d",&a);
    p=(int*)malloc(a*sizeof(int));
    for(i=0;i<a;i++)
    printf("%d\n",i);
    printf("Enter new size of array");
    scanf("%d",&b);
    realloc(p,b);
    for(i=0;i<b;i++)
    printf("%d\n",i);
    free(p);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
55
The type of linked list in which the node does not contain any pointer or reference to the previous node is . . . . . . . .
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
56
In the function malloc(), each byte of allocated space is initialized to zero.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
57
The number of arguments taken as input which allocating memory dynamically using malloc() is . . . . . . . .
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
58
Choose the statement which is incorrect with respect to dynamic memory allocation.
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
59
Pick out the correct statement with respect to the heap.
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
60
The size of both stack and heap remains the same during run time.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board