Шукаєте відповіді та рішення тестів для Programming (UWE)? Перегляньте нашу велику колекцію перевірених відповідей для Programming (UWE) в e.tsi.lv.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
Question 3:
You are tasked with manipulating a dynamic 2D square matrix, where the size of the matrix will be provided by the user. Write a C++ program to achieve the following:
1) Write a program that creates a dynamic 2D matrix of size N x N, where N is provided by the user.
2) Fill the matrix with random integer numbers in the range from 0 to 100.
3) The program should find the row with the minimum sum of elements and the column with the maximum average value.
4) the program's operation must be accompanied by the output of a matrix, intermediate and final results.
4. What is the output of the following program?
#include<iostream>
using namespace std;
void f() {
static int i;
++i;
cout<<i<<" ";
}
main() {
f();
f();
f();
}
2. Which of the following C++ conditions will evaluate as true?
24. What is the correct definition of a
25. Match the data type in C++ with its typical size (on most modern systems with GCC 64-bit Windows):
26. How many times will this loop execute?
#include <iostream>
using namespace std;
int main() {
int count = 0;
for (int i = 0; i < 10; i++) {
i += 2;
count++;
}
cout << count << endl;
return 0;
}
23. What will this program print?
#include <iostream>
using namespace std;
int main() {
int x = 3;
if (x = 5) {
cout << "True" << endl;
} else {
cout << "False" << endl;
}
return 0;
}
8. Which statement correctly initializes an array of 5 integers with values 1, 2, 3, 4, and 5?
21. What is wrong with the following program?
#include <iostream>
using namespace std;
int main() {
int x;
cout << "Enter a number: ";
cin >> x;
if (x = 5) {
cout << "x is equal to 5" << endl;
}
return 0;
}
14. What is the difference between a for loop and a while loop in C++?