Search Header Logo

Programming in C Lab quiz II

Authored by Balamurugan Munisamy

Computers

12th Grade

Used 1+ times

Programming in C Lab quiz II
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a pointer in C?

A pointer in C is a variable that stores the memory address of another variable.

A pointer in C is a data type that stores multiple values

A pointer in C is a function that returns a memory address

A pointer in C is a keyword used to declare constants

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you handle files in C?

Delete files directly without closing them

Use Python instead of C

Print files to the console instead of reading/writing

Include , open file with fopen(), read/write with functions like fscanf(), fprintf(), fread(), fwrite(), and close file with fclose().

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the concept of functions in C.

Functions in C do not have a return type.

Functions in C are blocks of code that perform a specific task. They are reusable and modular, allowing for better organization and easier debugging. Functions in C have a return type, a name, parameters, and a body where the actual code is written.

Functions in C cannot have parameters.

Functions in C are used for decorative purposes only.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are arrays in C?

Arrays in C can only store primitive data types and not complex objects.

Arrays in C are limited to a fixed number of elements and cannot be resized.

Arrays in C are a collection of elements of the same data type stored in contiguous memory locations.

Arrays in C are a collection of elements of different data types stored in non-contiguous memory locations.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you perform dynamic memory allocation in C?

Dynamic memory allocation is not possible in C

Declare a static array with a large size to allocate memory

Use functions like malloc, calloc, or realloc to allocate memory during runtime and free the memory using the free function.

Use functions like free, allocate, or reserve to allocate memory

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the significance of command line arguments in C?

They provide a way to customize program behavior without modifying the source code.

They allow the program to run faster

They are used for debugging purposes only

They are only used in object-oriented programming languages

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for declaring a pointer in C?

int ptr*;

int *ptr;

int* ptr;

int ptr;

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?