Qualcomm Pointers Quiz-1

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

["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%

Completed

0/10

Accuracy

0%

Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

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.

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.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects

Comments