Search Header Logo
Pointers in C

Pointers in C

Assessment

Presentation

Computers

Professional Development

Medium

Created by

poturaju puppala

Used 29+ times

FREE Resource

1 Slide • 8 Questions

1

Pointers in C

Slide image

2

Multiple Choice

Question image

Code to change the 3rd array value to 50 using pointers

int main(){

int a[] = {10,20,30};

int *p = a;

----------------------;

}

1

p+3 = 50

2

*(p+3) = 50

3

*p+2 = 50

4

*(p+2) = 50

3

Multiple Choice

Point out the compile time error in the program given below.

#include<stdio.h>


int main()

{

int *x;

*x=100;

return 0;

}

1

Error: invalid assignment for x

2

Error: suspicious pointer conversion

3

No error

4

None of the above

4

Multiple Choice

In a C program,

int a = 20;

*ptr = &a;

**dptr = &ptr;

printf ("%d", **dptr);


prints

1

address of a

2

address of ptr

3

value of a

4

address of dptr

5

Multiple Choice

In a C Program if

int a = 5;

Int *ptr = &a;

then the printf statement with

&a, a, *ptr , ptr

1

adrress, Value, Value, Adress

2

address, value, value, value

3

all address

4

All values

6

Multiple Choice

In a C program,

int a = 20;

*ptr = &a;

**dptr = &ptr;

printf ("%d", **dptr);


prints

1

address of a

2

address of ptr

3

value of a

4

address of dptr

7

Multiple Choice

which of the following is the dereference operator

1

&

2

*

3

#

4

@

8

Multiple Choice

int a=10;

int *b=&a,**c=&b;

**c=*b-**c;

what is the value of a?

1

10

2

5

3

0

4

4

9

Multiple Select

which of the following defines NULL pointer

1

data_type * var=NULL;

2

data_type *var=0;

3

data_type *var='\0';

4

all the above

Pointers in C

Slide image

Show answer

Auto Play

Slide 1 / 9

SLIDE