Search Header Logo

C Programming Fundamentals Assessment

Authored by priyanka shelar

Computers

University

Used 3+ times

C Programming Fundamentals Assessment
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 the correct way to initialize an array in C?

int arr(3) = {1, 2, 3};

int arr = {1, 2, 3};

int arr[] = {1, 2, 3};

int arr[3] = new int[3]{1, 2, 3};

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a function prototype in C?

functionName(int, int) int;

functionName(int, int): int;

void functionName(int, int){}

int functionName(int, int);

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which control flow statement is used to execute a block of code multiple times?

Function

Switch

Loop

Condition

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for declaring a two-dimensional array in C?

type arrayName[rows][columns];

arrayName[rows, columns];

type arrayName(rows, columns);

arrayName{rows}{columns};

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you pass an array to a function in C?

Use 'functionName(arrayName, size)' without specifying data type.

Declare the array globally and access it directly in the function.

Use the syntax 'functionName(dataType arrayName[], int size)' to pass the array and its size.

Pass the array as a pointer without its size.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

To declare variables in C.

To create loops in C.

To execute code conditionally based on a boolean expression.

To define a function in C.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you initialize a multi-dimensional array in C?

int arr[2][3] = {{1, 2, 3}, {4, 5, 6}};

int arr[2][3] = {1, 2, 3; 4, 5, 6};

int arr[3][2] = {1, 2, 3, 4, 5, 6};

int arr[2][3] = {{1, 2}, {3, 4}, {5, 6}};

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?