C Programming Fundamentals Assessment

C Programming Fundamentals Assessment

University

20 Qs

quiz-placeholder

Similar activities

Array Java

Array Java

University

15 Qs

2-D Arrays in Java

2-D Arrays in Java

University

20 Qs

Linux 3-4

Linux 3-4

University

20 Qs

cs1300-F17-Week8

cs1300-F17-Week8

12th Grade - University

15 Qs

PSC Quiz1

PSC Quiz1

University - Professional Development

20 Qs

A Quiz on C Programming

A Quiz on C Programming

University

20 Qs

Computer Science Quiz

Computer Science Quiz

University

15 Qs

Data Structures

Data Structures

University

20 Qs

C Programming Fundamentals Assessment

C Programming Fundamentals Assessment

Assessment

Quiz

Computers

University

Hard

Created by

priyanka shelar

Used 3+ times

FREE Resource

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}};

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?