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 ** mas = new int*[5];
for (int i = 0; i<5; i++)
{
mas[i] = new int[5];
for (int j = 0; j<5; j++)
mas[i][j] = i * 5 + j;
}
for (int i = 0; i<5; i++)
cout << *&mas[i][i] << '\t';
Код програми, поданий нижче ,буде скомпільовано і виконано без помилок:
#include <iostream>
using namespace std;
void main()
{
int rows = 3, cols = 5;
int ** mas = new int*[rows];
int i;
for (i = 0; i<rows; i++)
mas[i] = new int[cols];
cout << mas[i] << "\t";
for (i = 0; i<cols; i++)
delete[] mas[i];
delete[] mas;
}
Код програми, поданий нижче буде скомпільовано без помилок:
#include <iostream>
#include <stdlib.h>
using namespace std;
void main()
{
char str[20];
itoa(65, str, 8);
cout << str;
}
Скільки разів виконається тіло циклу
int j=2; while(j<25) j += j--;
Скільки разів виконається тіло циклу
for(int a=1; a<22; a++) a *= a;
Що буде виведено на екран внаслідок виконання наступного фрагмента коду:
#include <iostream>
using namespace std;
class A{
int *a;
public:
A(int x)
{
a = new int(x);
cout << "A(" << x << ")\n";
}
~A()
{
delete a;
cout << "~A()\n";
}
};
A f()
{
A a1(123);
return a1;
}
void main(){
f();
}
Який результат виконання наступного фрагмента коду:
int i = 1;
while (i%5 != 0)
{
{
cout << i;
}
i++;
}
return 0;
Який результат виконання наступного фрагмента коду:
char str[20] = { 0 }, str2[25];
for (int i = 0; i<5; i++)
{
str[i] = 'A' + i;
str2[i] = 'a' + i;
}
cout << str << '\t' << str2 << '\n';
у
int y = 101;
for (int x = 1; y > x; y -= x)
{
cout << x<<endl;
x++;
}
Який результат виконання наступного фрагмента коду:
int y, x = 1, total = 0;
while (x <= 5)
{
x++;
y = x*x;
total += y;
}
cout << total;