C Programming Challenge

C Programming Challenge

12th Grade

15 Qs

quiz-placeholder

Similar activities

Pretest 7 Self Introduction

Pretest 7 Self Introduction

9th - 12th Grade

10 Qs

Tiếng Anh 2 Unit 8

Tiếng Anh 2 Unit 8

KG - Professional Development

12 Qs

統測單字11.12 +形容詞子句

統測單字11.12 +形容詞子句

10th - 12th Grade

14 Qs

UH 2

UH 2

9th - 12th Grade

10 Qs

UNIT 2. VOCAB & GRAM

UNIT 2. VOCAB & GRAM

10th - 12th Grade

10 Qs

Test 5

Test 5

12th Grade

15 Qs

English 12: Review 1

English 12: Review 1

12th Grade

20 Qs

e 12 - language

e 12 - language

12th Grade

10 Qs

C Programming Challenge

C Programming Challenge

Assessment

Quiz

English

12th Grade

Practice Problem

Medium

Created by

Rahul undefined

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax to declare a pointer in C?

int *ptr;

char *ptr;

double *ptr;

void *ptr;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between 'malloc' and 'calloc' functions in C.

malloc allocates uninitialized memory block, calloc allocates initialized memory block with all bits set to zero

malloc allocates memory in stack, calloc allocates memory in heap

malloc is used for allocating memory for arrays, calloc is used for allocating memory for variables

malloc and calloc are interchangeable functions in C

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you pass arguments by reference in C?

Pass the address of the variable as an argument to the function and dereference the pointer inside the function to access and modify the original variable.

Pass the value of the variable as an argument to the function

Use a global variable to pass arguments by reference

Pass a copy of the variable to the function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'sizeof' operator in C?

To calculate the square root of a number

To convert a variable to a different data type

To determine the size in bytes of a data type or a variable.

To check if a variable is initialized

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between 'while' and 'do-while' loops in C.

Both 'while' and 'do-while' loops have the same behavior

In 'while' loop, the condition is checked after executing the block of code

In 'while' loop, the condition is checked before executing the block of code, whereas in 'do-while' loop, the block of code is executed at least once before checking the condition.

In 'do-while' loop, the block of code is executed only if the condition is true

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the 'switch' statement used for in C?

It is used for creating loops in C.

It is used for defining variables in C.

It is used for multi-way branching based on the value of a variable or expression.

It is used for handling exceptions in C.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you dynamically allocate memory in C?

pointer_variable = (cast-type*) calloc(size);

pointer_variable = (cast-type*) malloc(size);

pointer_variable = (cast-type*) free(size);

pointer_variable = (cast-type*) realloc(size);

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?