Write a C++ program executing matrix addition for two 2×2 matrices.
Two 2x2 matrices input sequentially.
Print resulting 2x2 sum matrix.
Matrix elements integers
1 2 3 4 5 6 7 8
6 8 10 12
Performs element-wise matrix addition.
#include <iostream>
int main() {
int a[2][2], b[2][2];
bool ok = true;
for(int i=0; i<2; i++) for(int j=0; j<2; j++) if(!(std::cin >> a[i][j])) ok = false;
for(int i=0; i<2; i++) for(int j=0; j<2; j++) if(!(std::cin >> b[i][j])) ok = false;
if(ok) {
// Write your matrix addition logic here
}
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