Question 1

Time: 00:00:00

In which header file is the NULL macro defined?

stdio.h

stdio.h

stddef.h

stddef.h

stdio.h and stddef.h

stdio.h and stddef.h

math.h

math.h

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 2

Time: 00:00:00

Can you combine the following two statements into one?

char *p;
p = (char*) malloc(100);

char p = *malloc(100);

char p = *malloc(100);

char *p = (char) malloc(100);

char *p = (char) malloc(100);

char *p = (char*)malloc(100);

char *p = (char*)malloc(100);

char *p = (char *)(malloc*)(100);

char *p = (char *)(malloc*)(100);

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
What would be the equivalent pointer expression for referring the array element a[i][j][k][l]

((((a+i)+j)+k)+l)

((((a+i)+j)+k)+l)

*(*(*(*(a+i)+j)+k)+l)

*(*(*(*(a+i)+j)+k)+l)

(((a+i)+j)+k+l)

(((a+i)+j)+k+l)

((a+i)+j+k+l)

((a+i)+j+k+l)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 4

Time: 00:00:00

What will be the output of the program ?


#include

int main()
{
int i=3, *j, k;
j = &i;
printf("%d\n", i**j*i+*j);
return 0;
}

30

30

27

27

9

9

3

3

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
What will be the output of the program ?


#include

int main()
{
int x=30, *y, *z;
y=&x; /* Assume address of x is 500 and integer is 4 byte size */
z=y;
*y++=*z++;
x++;
printf("x=%d, y=%d, z=%d\n", x, y, z);
return 0;
}

x=31, y=502, z=502

x=31, y=502, z=502

x=31, y=500, z=500

x=31, y=500, z=500

x=31, y=498, z=498

x=31, y=498, z=498

x=31, y=504, z=504

x=31, y=504, z=504

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00
What will be the output of the program?


#include

int main()
{
int arr[3] = {2, 3, 4};
char *p;
p = arr;
p = (char*)((int*)(p));
printf("%d, ", *p);
p = (int*)(p+1);
printf("%d", *p);
return 0;
}

2, 3

2, 3

2, 0

2, 0

2, Garbage value

2, Garbage value

0, 0

0, 0

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00
What will be the output of the program assuming that the array begins at location 1002?


#include

int main()
{
int a[2][3][4] = { {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2},
{2, 1, 4, 7, 6, 7, 8, 9, 0, 0, 0, 0} };
printf("%u, %u, %u, %d\n", a, *a, **a, ***a);
return 0;
}

1002, 2004, 4008, 2

1002, 2004, 4008, 2

2004, 4008, 8016, 1

2004, 4008, 8016, 1

1002, 1002, 1002, 1

1002, 1002, 1002, 1

Error

Error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
What will be the output of the program ?


#include
power(int**);
int main()
{
int a=5, *aa; /* Address of 'a' is 1000 */
aa = &a;
a = power(&aa);
printf("%d\n", a);
return 0;
}
power(int **ptr)
{
int b;
b = **ptr***ptr;
return (b);
}

5

5

25

25

125

125

Garbage value

Garbage value

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 9

Time: 00:00:00

What will be the output of the program ?

#include
#include

int main()
{
int i, n;
char *x="Alice";
n = strlen(x);
*x = x[n];
for(i=0; i<=n; i++)
{
printf("%s ", x);
x++;
}
printf("\n", x);
return 0;
}

Alice

Alice

ecilA

ecilA

Alice lice ice ce e

Alice lice ice ce e

lice ice ce e

lice ice ce e

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00

Which of the following statements correct about k used in the below statement?
char ****k;

k is a pointer to a pointer to a pointer to a char

k is a pointer to a pointer to a pointer to a char

k is a pointer to a pointer to a pointer to a pointer to a char

k is a pointer to a pointer to a pointer to a pointer to a char

k is a pointer to a char pointer

k is a pointer to a char pointer

k is a pointer to a pointer to a char

k is a pointer to a pointer to a char

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

["0","40","60","80","100"]
["Need more practice! \r\n","Keep trying! \r\n","Not bad! \r\n","Good work! \r\n","Perfect! \r\n"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Comments