C Programming Mastery Challenge

C Programming Mastery Challenge

University

20 Qs

quiz-placeholder

Similar activities

C Programming Array Concepts

C Programming Array Concepts

University

15 Qs

DSA Quest 1.0

DSA Quest 1.0

University

19 Qs

Zenorix 2023

Zenorix 2023

University

20 Qs

Arrays and pointers quiz

Arrays and pointers quiz

University

20 Qs

Array Addresses 2024

Array Addresses 2024

University

20 Qs

Pointers in C

Pointers in C

University

24 Qs

Linked List and Arrays in JAVA

Linked List and Arrays in JAVA

University

16 Qs

Arrays and Pointers in C

Arrays and Pointers in C

University

15 Qs

C Programming Mastery Challenge

C Programming Mastery Challenge

Assessment

Quiz

Computers

University

Medium

Created by

REVATHI R

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is a pointer in C and how is it declared?

A pointer in C is declared using the syntax 'type *pointerName;', for example, 'int *ptr;'

A pointer in C is declared using 'type &pointerName;'.

A pointer in C is declared with the syntax 'pointerName : type;'.

A pointer in C is a variable that holds a string value.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Explain the difference between a pointer and a regular variable.

A pointer holds a memory address, whereas a regular variable holds a value.

A regular variable can hold a memory address.

Pointers can only store integer values.

A pointer is a type of regular variable.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you dynamically allocate memory in C?

Use 'new' to allocate memory in C.

Use 'malloc', 'calloc', or 'realloc' to dynamically allocate memory in C.

Use 'free' to allocate memory in C.

Use 'printf' to allocate memory in C.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of the 'free' function in C?

To copy data from one memory location to another.

The purpose of the 'free' function in C is to deallocate previously allocated memory.

To initialize memory to zero.

To allocate new memory for variables.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code: int a = 5; int *p = &a; printf('%d', *p);?

5

4

6

10

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the precedence of the arithmetic operators in C?

Parentheses, Addition/Subtraction, Multiplication/Division/Modulus, Unary operators

Unary operators, Addition/Subtraction, Parentheses, Division/Multiplication

Parentheses, Unary operators, Multiplication/Division/Modulus, Addition/Subtraction

Addition/Subtraction, Parentheses, Unary operators, Division/Modulus

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you increment a pointer in C?

ptr+=1

ptr++

ptr--

ptr=ptr+1

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?