Strings

Strings

University

6 Qs

quiz-placeholder

Similar activities

Tes Awal AlPro Modul 6

Tes Awal AlPro Modul 6

University

10 Qs

program computer

program computer

University

10 Qs

Alghorithma

Alghorithma

12th Grade - University

10 Qs

Array and string unit 7

Array and string unit 7

University

10 Qs

Kuis Asistensi Modul 3

Kuis Asistensi Modul 3

University

7 Qs

c-languiz

c-languiz

University

10 Qs

UAS Praktikum: Logika dan Algoritma Pemrograman

UAS Praktikum: Logika dan Algoritma Pemrograman

1st Grade - University

10 Qs

PROGRAMACION

PROGRAMACION

9th Grade - University

10 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