Write a C++ program allocating a dynamic 2×2 matrix using pointers-to-pointers (`int **`), populating values, and deallocating memory properly.
4 integers representing a 2x2 matrix.
Print 2x2 matrix elements row by row.
-100 <= Elements <= 100
1 2 3 4
1 2 3 4
Manages dynamic 2D arrays using an array of pointer rows.
#include <iostream>
int main() {
int **mat = new int*[2];
for (int i = 0; i < 2; i++) mat[i] = new int[2];
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
std::cin >> mat[i][j];
}
}
// Write your code here to print matrix and free memory
return 0;
}Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used