Metodo De Gauss.docx

  • Uploaded by: joiner herazo
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Metodo De Gauss.docx as PDF for free.

More details

  • Words: 275
  • Pages: 2
//METODO DE GAUSS #include #include<stdio.h> #include #include<stdlib.h> int i, j, k, n; double m[20][20], aux; using namespace std; int main() { cout << " <<<<Metodo de Gauss >>>> "; cout << "\n Matriz cuadrada de orden N= "; cin >> n; cout << "\n Digite los elementos de la matriz en la posicion "; for (i = 1;i <= n;i++) // for(inicialización; condición; iteración) "PARA i FILAS" { for (j = 1;j <= n;j++) // Ciclo for "PARA j COLUMNAS" { cout << "\n M=[" << i << "," << j << "]= "; cin >> m[i][j]; //PARA ESTE CICLO VA INCREMENTO PARA j (COLUMNAS) } cout << "\n Termino independiente de X" << i << " "; cin >> m[i][n + 1]; // incremento de la fila hasta ser <= n } for (i = 1;i <= n;i++) { if (m[i][i] != 0) { aux = 1 / m[i][i]; for (j = 1;j <= n + 1;j++) { m[i][j] = aux*m[i][j]; } for (j = 1;j <= n;j++) { if (j != i) { aux = -m[j][i]; for (k = 1;k <= n + 1;k++) { m[j][k] = m[j][k] + aux*m[i][k]; } } } } } cout << "\n" << aux << endl; cout << "la matriz identidad es";

cout << "\n\n"; for (i = 1;i <= n;i++) { for (j = 1;j <= n;j++) { cout << m[i][j] << "\t"; } cout << "\n\n"; } cout << "El valor de las incognitas es : "; for (i = 1;i <= n;i++) { cout << "\nX" << i << " = " << m[i][n + 1] << "\n"; } system ("pause"); return 0; }

Related Documents

Metodo De Fermat
April 2020 7
Informe De Metodo Sanger
November 2019 13
Metodo De Sor
June 2020 5
Cuestiones De Metodo
May 2020 11

More Documents from ""