Have you not taken the time to search the web for examples?
If you search for "linear equations c++" you should find numerous.
e.g. -
C++ Program to Solve any Linear Equation in One Variable
https://www.tutorialspoint.com/cplusplus-program-to-solve-any-linear-equation-in-one-variable
Linear Equation Solver in C++
https://www.codeproject.com/articles/675908/linear-equation-solver-in-cplusplus
Gaussian elimination in C++
https://www.codespeedy.com/gaussian-elimination-in-cpp/
"In this tutorial, we will learn how to solve linear equations
using Gaussian elimination in C++."
- Wayne