Search Header Logo

C Strings Quiz

Authored by priyanka it

Computers

3rd Grade

Used 2+ times

C Strings Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the correct way to declare a string in C?

char myString[] = "Hello";

char myString[6] = 'Hello';

string myString = 'Hello';

char myString = 'Hello';

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

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

strlength()

strlen()

stringlength()

len()

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How do you concatenate two strings in C?

strcat(string1, string2)

concat(string1, string2)

strncat(string1, string2, n)

append(string1, string2)

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which function is used to compare two strings in C?

strcmp()

add()

multiply()

divide()

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the correct way to input a string in C?

input()

print()

cin >>

scanf()

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which function is used to find the first occurrence of a character in a string in C?

findchar()

strrchr()

strchr()

index()

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the correct way to copy one string to another in C?

moveString(destination, source)

copyString(destination, source)

duplicateString(destination, source)

strcpy(destination, source)

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?