PROGRAMMING IN C - UNIT 3 MCQS

PROGRAMMING IN C - UNIT 3 MCQS

12th Grade

15 Qs

quiz-placeholder

Similar activities

Topic 3 & 4 Practice - ArrayList and String Methods

Topic 3 & 4 Practice - ArrayList and String Methods

12th Grade

15 Qs

L.8. STRINGS AND STRING MANIPULATION -1

L.8. STRINGS AND STRING MANIPULATION -1

12th Grade

10 Qs

คำสั่งพื้นฐานในภาษา Python (เก็บคะแนนครั้งที่ 2)

คำสั่งพื้นฐานในภาษา Python (เก็บคะแนนครั้งที่ 2)

12th Grade

20 Qs

CSA Unit 3 Review

CSA Unit 3 Review

10th - 12th Grade

16 Qs

Șiruri de caractere - funcții

Șiruri de caractere - funcții

10th Grade - University

15 Qs

UAS Praktikum: Logika dan Algoritma Pemrograman

UAS Praktikum: Logika dan Algoritma Pemrograman

1st Grade - University

10 Qs

Objekti in razredi JavaScripta

Objekti in razredi JavaScripta

10th - 12th Grade

12 Qs

Java - arrays and String methods

Java - arrays and String methods

9th - 12th Grade

12 Qs

PROGRAMMING IN C - UNIT 3 MCQS

PROGRAMMING IN C - UNIT 3 MCQS

Assessment

Quiz

Computers

12th Grade

Hard

Created by

MS.SHYAMALADEVI C

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a character array in C?

A character array is used to store floating-point numbers.

A character array is a type of integer array.

A character array is a single character variable.

A character array in C is a sequence of characters used to store strings, defined as 'char arrayName[size];'.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a string in C?

char stringName = 'Your string here';

string stringName = 'Your string here';

char stringName[] = "Your string here";

char *stringName = 'Your string here';

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between a character array and a string.

A string is a fixed-size array, whereas a character array can change size dynamically.

Strings can only contain letters, while character arrays can contain any data type.

A character array is a type of string.

A character array is a raw collection of characters, while a string is a character array with additional properties and functions.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What function is used to find the length of a string in C?

getLength

lengthOfString

strlength

strlen

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you copy one string to another in C?

Use copy(destination, source);

Use strcpy(destination, source);

destination = source;

strncpy(destination, source, length);

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the `strcat` function?

To find the length of a string.

To split a string into characters.

To concatenate two strings.

To convert a string to uppercase.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you compare two strings in C?

Use strcmp(string1, string2) to compare two strings.

Check if string1 == string2 for comparison.

Use str_compare(string1, string2) to compare two strings.

Use string1.equals(string2) to compare two strings.

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?