#include <iostream>
using namespace std;
const int N = 3;
void swap(double matrix[N][N + 1], int i, int j)
{
...
}
int forwardElim(double mat[N][N + 1])
{
...
}
void backSub(double mat[N][N + 1])
{
...
}
void gaussianElimination(double mat[N][N + 1])
{
...
}
int main()
{
int i, j;
double matrix[N][N+1];
int k = 1;
for (i = 0; i < N; i++)
{
cout << "Enter value for equation " << k << ": " << endl;
for (j = 0; j < N +1; j++)
{
cout << "[" << i << "]" << "[" << j << "] = ";
cin >> matrix[i][j];
}
k++;
}
cout << "Your equation is: " << endl;
for (i = 0; i < N; i++) {
for (j = 0; j < N+1; j++) {
cout << matrix[i][j] << " ";
}
cout << endl;
}
gaussianElimination(matrix);
system("pause");
}
I'm a newbie so can anyone help me with this basic question, please. How can I get any value of N from the keyboard but outside the main function? Because I still have some function outside of main using N