logo

Crowdly

Browser

Add to Chrome

Questions Bank (1300818 total)

What is the output of the following code fragment?

int a[] { 2, 1, 0 };

int n = 0;

for (int v : a) { v++; n += v; }

for (int& v : a) { n++; v += n; }

std::cout << n << ' '

<< a[0] << ' ' << a[1] << ' ' << a[2] << '\n';

0%
100%
0%
0%
View this question

What is the output of the following code fragment?

char s[] = "2LEIC 022";

int i = 0;

do { i++; } while (s[i] != '\0' && s[i] != '2');

s[i] = '\0';

std::cout << i << " \"" << s << "\"\n";

100%
0%
0%
0%
View this question

Consider (as usual in 64-bit machines) that values of type int, and char

are represented using 4 and 1 bytes in memory, respectively. What is the output of the following program (assuming no padding is necessary for the struct

types involved)?

struct event {

char id[4];

int code;

};

struct week {

int number;

event events[7];

};

int main() {

week w;

std::cout << sizeof(w) << '\n';

return 0;

}

0%
0%
100%
0%
View this question

For what value of i

, read from the input in the following code fragment, there is a buffer overflow?

struct data { int x; int y; };

data a[] { {1, 2}, {3, 3}, {2, 1}, {0, 0} };

int i;

std::cin >> i;

std::cout << a[a[a[i].x].y - 1].x;

0%
0%
0%
0%
View this question

Соотнесите этап цикла управления БП с его действием

View this question

Історико-літературні

твори другої половини XVII - сер.XVIІI ст., присвячені козацьким війнам - це...

0%
0%
0%
0%
0%
View this question

Стиль бароко поширився

на українських землях з...

0%
100%
0%
0%
View this question

Український

мандрівний філософ-проповідник ХVІІІ ст....

0%
0%
0%
0%
0%
View this question

Вершину українського літописання

епохи бароко складають твори

0%
0%
0%
0%
View this question

Входная мощность определяет

0%
0%
100%
0%
0%
View this question