Write a C++ program checking a 3×3 Tic Tac Toe grid for a winning condition (‘X’ or ‘O’).
A 3x3 character matrix representing the board state.
Print 'X Wins', 'O Wins', or 'Ongoing'.
Grid elements are 'X', 'O', or '.'
X X X . O . . O .
X Wins
Evaluates rows, columns, and diagonals for matching symbols.
#include <iostream>
#include <vector>
int main() {
char grid[3][3];
bool ok = true;
for(int i=0; i<3; i++) {
for(int j=0; j<3; j++) {
if(!(std::cin >> grid[i][j])) ok = false;
}
}
if(ok) {
// Write your tic tac toe validator 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