Strings

Strings

University

6 Qs

quiz-placeholder

Similar activities

Struct

Struct

University

8 Qs

IQ Game

IQ Game

University

10 Qs

ฟังก์ชั่น

ฟังก์ชั่น

1st Grade - Professional Development

10 Qs

Desa App y Algoritmos

Desa App y Algoritmos

6th Grade - University

10 Qs

A5 IB -  Variables y Constantes en Python

A5 IB - Variables y Constantes en Python

10th Grade - University

10 Qs

Week8

Week8

University

8 Qs

Review Quiz B1 - Working with Numbers

Review Quiz B1 - Working with Numbers

11th Grade - University

8 Qs

Estructurada- Diagramas de Flujo

Estructurada- Diagramas de Flujo

University

11 Qs

Strings

Strings

Assessment

Quiz

Computers

University

Hard

Created by

Pavol Zajac

Used 6+ times

FREE Resource

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is returned from strlen("test\n");

4

5

6

7

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given char buffer[81], which statement correctly reads a single line into buffer?

gets(buffer);

fgets(buffer, 81, stdin);

scanf("%s", buffer);

scanf("%80s", buffer);

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given char buffer[81], which statement correctly reads a single word into buffer?

gets(buffer);

fgets(buffer, 81, stdin);

scanf("%s", buffer);

scanf("%80s", buffer);

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which expression is true, if pointer test points to string with content "test"?

test == "test"

strcmp(test, "test") == 0

strcmp(test, "test")

strstr(test, "test") == 0

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

We have char str[81] = "test". How do we concatenate it with "string"?

strcat(str, "string");

strcpy(str, "string");

str += "string";

str = "teststring";

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Let

char *test = "teststring";

char *ptr = strstr(test, "str");

What is the value of ptr - test?

Undefined.

0

4

5