Looking for Обчислювальна техніка та програмування [04123] test answers and solutions? Browse our comprehensive collection of verified answers for Обчислювальна техніка та програмування [04123] at vns.lpnu.ua.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Фрагмент коду, поданий нижче містить "вічний" цикл:
int i = 0, a = 4;
while (i<a)
cout << a - i;
i++;
Який з перелічених операторів є оператором присвоєння в мові С?
Який результат виконання наступного фрагмента коду:
Який результат виконання наступного фрагмента коду:
int i = 2;
while (i<7)
{
if (i != 5)
i++;
else
cout << i++ << " ";
}
Що буде виведено на екран внаслідок виконання наступного фрагмента коду:
#include <iostream>
using namespace std;
class A{
int *a;
public:
A(int x)
{
a = new int(x);
cout << "A(" << x << ")\n";
}
A(const A &a1)
{
cout << "A(const A" << "&a1)\n";
a = new int(*(a1.a));
}
~A()
{
delete a;
cout << "~A()\n";
}
};
A f()
{
A a1(123);
return a1;
}
void main(){
f();
}
Який результат виконання наступного фрагмента коду:
char str[] = "Alphabet - a b c d e f";
char* ptr = strstr(str, "a");
while (ptr)
{
cout << ptr - str << '\t';
ptr = strstr(ptr + 1, "a");
}
Який результат виконання наступного фрагмента коду:
const int k = 5;
int mas[k] = { 1, 2, 4, 9, 0, 7 };
for (int i = 0; i<k; i += 3)
cout << mas[i] << " ";
return 0;
Код програми, поданий нижче ,буде скомпільовано і виконано без помилок:
#include <iostream>
using namespace std;
void main()
{
int rows = 5, cols = 3, count = 0;
int ** mas = new int*[rows];
for (int i = 0; i < rows; i++)
{
mas[i] = new int[cols];
for (int j = 0; j < cols; j++, count++)
mas[i][j] = count;
}
for (int i = 0; i < rows; i++)
cout << *mas[i] << "\t";
for (int i = 0; i < rows; i++)
delete[]mas[i];
delete[]mas;
}
Який результат виконання наступного фрагмента коду:
int i = 0;
do{
i++;
} while (i<0);
cout << i;