gauss elimination with pivoting and using fuctions with matrix A,vector X and B as a global variable