Let's Crack C Prelims

Let's Crack C Prelims

Assessment

Flashcard

Created by

Quizizz Content

Computers

University

Hard

Student preview

quiz-placeholder

20 questions

Show all answers

1.

FLASHCARD

Front

Which one is a valid variable name in C? Options: @variable, 123_variable, _variable, variable#

Back

_variable

2.

FLASHCARD

Front

What is the purpose of the 'if' statement?

Back

To control the flow of execution based on conditions.

3.

FLASHCARD

Front

How is a function defined in C?

Back

A function in C is defined using the syntax: return_type function_name(parameter_type parameter_name) { // function body }

4.

FLASHCARD

Front

What is the purpose of the 'switch' statement in C?

Back

To execute a block of code based on the value of a variable.

5.

FLASHCARD

Front

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

Back

A pointer is a variable that holds the address of another variable, used for direct memory access and manipulation in C.

6.

FLASHCARD

Front

How do you dynamically allocate memory in C?

Back

Use 'malloc(size)' to allocate memory and 'free(pointer)' to deallocate it.

7.

FLASHCARD

Front

What is the difference between an array and a string in C?

Back

An array is a collection of elements of the same type, while a string is a specific type of array that represents a sequence of characters terminated by a null character.

8.

FLASHCARD

Front

What is the significance of the 'return' statement in a function?

Back

It specifies the value that a function will return to the caller.

9.

FLASHCARD

Front

How do you access elements in an array?

Back

Use array[index] to access elements.

10.

FLASHCARD

Front

What is the role of header files in C programming?

Back

They provide declarations for functions and macros used in the program.

Explore all questions with a free account

or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?