What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 4;
int *p = &x;
int *k = p++;
int r = p – k;
printf(“%d”, r);
}
a) 4
b) 8
c) 1
d) Run time error
Answer: c
Related Posts
Given an array of size n, let’s assume an element is ‘touched’ if and only if some operation is performed on it(for example, for performing a pop operation the top element is ‘touched’). Now you need to perform Dequeue operation. Each element in the array is touched atleast?
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
What does the following function do for a given Linked List with first node as head?
void fun1(struct node* head)
{
if(head == NULL)
return;
fun1(head->next);
printf(“%d “, head->data);
}Which of the following points is/are not true about Linked List data structure when it is compared with an array?
Linked list data structure offers considerable saving in _____________
In Linked List implementation, a node carries information regarding ___________
Linked list is considered as an example of ___________ type of memory allocation.
Join The Discussion