Exploring C: Strings, Arrays, Functions

Exploring C: Strings, Arrays, Functions

University

15 Qs

quiz-placeholder

Similar activities

Java Lesson 11

Java Lesson 11

5th Grade - University

10 Qs

C Programming First Quiz - Sec H

C Programming First Quiz - Sec H

University

10 Qs

UTS - Struktur Data

UTS - Struktur Data

University

20 Qs

JAVA FUNDAMENTALS

JAVA FUNDAMENTALS

University

12 Qs

Java Variables and Control Structures lec2

Java Variables and Control Structures lec2

University

10 Qs

QUIZ 2 - WEB PROGRAMMING CSC443

QUIZ 2 - WEB PROGRAMMING CSC443

University

10 Qs

Modul 3_Windry Dwi Juliani

Modul 3_Windry Dwi Juliani

University

10 Qs

execption handling

execption handling

University

17 Qs

Exploring C: Strings, Arrays, Functions

Exploring C: Strings, Arrays, Functions

Assessment

Quiz

Other

University

Hard

Created by

SYAM SANKAR

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a string in C programming?

A string in C is a type of function.

A string in C is a fixed-length integer.

A string in C is a single character.

A string in C is an array of characters ending with a null character.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare an array in C?

arrayName = new type[arraySize];

type arrayName[];

array arrayName(arraySize);

To declare an array in C, use the syntax: type arrayName[arraySize];

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'strlen' function?

To concatenate two strings together.

To find the first occurrence of a character in a string.

To determine the length of a string.

To convert a string to uppercase.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you initialize a string in C?

char str[] = "Hello, World!";

string str = "Hello, World!";

char str = 'Hello, World!';

char* str = 'Hello, World!';

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a character array and a string?

Strings are always mutable, whereas character arrays are immutable.

A character array can only store single characters, while a string can store multiple data types.

A character array is a type of string that cannot be modified.

A character array is a low-level representation of characters, while a string is a higher-level abstraction with built-in functionalities.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access elements in an array?

Use array[index] to access elements.

Elements can be accessed using array->index.

Access elements by calling array[index].get() method.

Use array.get(index) to access elements.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What function is used to copy strings in C?

strlen

sprintf

strcat

strcpy

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?