Hello, I decided to remake the code for the Kramer method. More precisely, it is better to issue and enter a condition if the determinant of the matrix is 0. But even before the introduction of this condition, an error occurred. I compile the code, enter values from the keyboard, and then before displaying the solution Invalid Floating point operation . As I understand it, the error is a floating point, and what is more specific it is. Explain, please.
#include <conio.h> #include <stdio.h> #include <vcl.h> #include <iostream> #pragma hdrstop char bufCur[256]; char* Cur(const char* text) { CharToOem(text, bufCur); return bufCur; } float vizn(float arr[][3]) { float vizn,p1,p2,p3; p1=arr[0][0]*arr[1][1]*arr[2][2]+arr[2][0]*arr[0][1]*arr[1][2]; p2=arr[0][2]*arr[1][0]*arr[2][1]-arr[2][0]*arr[1][1]*arr[0][2]; p3=-arr[0][0]*arr[2][1]*arr[1][2]-arr[1][0]*arr[0][1]*arr[2][2]; vizn=p1+p2+p3; return vizn; } #pragma argsused int main(int argc, char* argv[]) { float A[3][3]; int i, j; float B[3],V_A,x1,x2,x3,V_m_1,V_m_2,V_m_3,m_1[3][3],m_2[3][3],m_3[3][3]; V_A=vizn(A); printf(Cur("Введiть даннi в розширену матрицю:\n")); for (i=0;i<3;i++) { for(j=0;j<3;j++) { printf("A[%d][%d]=",i,j); scanf("%f",&A[i][j]); } } for (i=0;i<3;i++) { printf("B[%d]=",i); scanf("%f",&B[i]); } clrscr(); printf(Cur("\nРозширена матриця\n\n")); for(i=0;i<3;i++) { for(j=0;j<3;j++) { printf ("%.2f\t",A[i][j]); } printf("%.2f",B[i]); printf("\n"); } for(i=0;i<3;i++) { for(j=0;j<3;j++) { m_1[i][j]=A[i][j]; m_2[i][j]=A[i][j]; m_3[i][j]=A[i][j]; } } for(i=0;i<3;i++) { m_1[i][0]=B[i]; m_2[i][1]=B[i]; m_3[i][2]=B[i]; } V_m_1=vizn(m_1); V_m_2=vizn(m_2); V_m_3=vizn(m_3); x1=V_m_1/V_A;////////////////здесь выбивает x2=V_m_2/V_A; x3=V_m_3/V_A; printf(Cur("\nРозв'язок")); printf("\n\nx1=%.2f\nx2=%.2f\nx3=%.2f",x1,x2,x3); getch(); return 0; }