C Pointers 17May2023

C Pointers 17May2023

University

15 Qs

quiz-placeholder

Similar activities

Operators in C

Operators in C

University

12 Qs

BASIC C PROGRAMMING QUIZ

BASIC C PROGRAMMING QUIZ

University

15 Qs

ENT110 C Programming Quiz2

ENT110 C Programming Quiz2

University

10 Qs

Structures and union

Structures and union

University

15 Qs

POST TES MATRIKULASI

POST TES MATRIKULASI

10th Grade - University

10 Qs

Unit-2 Test-2

Unit-2 Test-2

University

15 Qs

C Programming Quiz

C Programming Quiz

12th Grade - University

20 Qs

Expression in C Programming

Expression in C Programming

University

10 Qs

C Pointers 17May2023

C Pointers 17May2023

Assessment

Quiz

Computers

University

Hard

Created by

A M Abirami

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

30 sec • 1 pt

How do you access the content of the pointer variable p inside the C program?

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

# include <stdio.h>

void fun(int x)

{     x = 30; }

 

int main()

{

  int y = 20;

  fun(y);

  printf("%d", y);

  return 0;

}

20, as the function call uses Call by value

20, as the function call uses Call by reference

30, as the function call changes the value

Error in this code

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

# include <stdio.h>

void fun(int *ptr)

{     *ptr = 30; }

 

int main()

{

  int y = 20;

  fun(&y);

  printf("%d", y);

 

  return 0;

}

30, as the function call is by Call by reference (i.e. call by address)

30, as the function call is by Call by value

20, as the variable ptr has scope local to the function

Compile time error

4.

FILL IN THE BLANK QUESTION

1 min • 1 pt

#include <stdio.h>

int main() {

int *ptr;

int x=5;

ptr = &x;

*ptr = 0;

printf("%d\n", x);

return 0;

}

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

#include <stdio.h>

int main() {

int *ptr;

int x=0;

ptr = &x;

*ptr = 10;

printf("%d\t %d\n", x, *ptr);

return 0;

}

10 10

10 0

0 10

10 Undefined

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

int main() {

int *ptr;

int x=10;

ptr = &x;

printf("%d\t %d\n", x, *ptr);

*ptr += 5;

printf("%d\t %d\n", x, *ptr);

return 0;

}

10 10 15 15

10 10 10 15

10 10 15 Undefined

Error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

int main() {

int *ptr;

int x=5, y;

ptr = &x;

y = x;

(*ptr)++;

printf("%d\t %d\n", x, y);

return 0;

}

6 5

5 6

Undefined 5

6 undefined

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?