Time Left - 15:00 mins
GATE 2025 Programming & Data Structures Foundation Quiz 3
Attempt now to get your rank among 45 students!
Question 1
Consider a 2D array A[-5….5][10……15], the base address is 100 and word length 2B find the address of the element A[2][13] using Row major order?
Question 2
What is the output of the following program in a 64 bit machine?(int will take 4 byte)
int main()
{
int a[] = {2, 3, 4};
printf(“%d %d %d”, sizeof(a), sizeof(&a), sizeof(a[0]));
}
int main()
{
int a[] = {2, 3, 4};
printf(“%d %d %d”, sizeof(a), sizeof(&a), sizeof(a[0]));
}
Question 3
Consider the following linked list.
Following operations are performed on this singly linked list:
i) struct node *p;
ii) p = s --> next -->next-->next-->next;
iii) s --> next -->next-->next = p -->next-->next ;
iv) p = s --> next -->next-->next-->next;
v) p --> next = s --> next -->next;
vi) Pf(s --> next -->next-->next --> next -->next-->next --> next -->next-->next--> next -->next-->next-->data)
What will the last statement print?
Question 4
What does the following code do (head is pointing to first node)?
void fun(struct node* head)
{
if(head == NULL)
return;
printf("%d ", head->data);
fun(head->next)
printf("%d ", head->data);
}
void fun(struct node* head)
{
if(head == NULL)
return;
printf("%d ", head->data);
fun(head->next)
printf("%d ", head->data);
}
Question 5
Consider the following Linked List and perform the following operations:
Let temp be the pointer to the first node
p = temp -> next
temp = p->next ->next
p -> next = temp -> next
What will be the result of (temp ->data) – (p->next->data).
- 45 attempts
- 0 upvotes
- 0 comments
Nov 10GATE & PSU CS