math.answers.com/calculus/C_program_for_gauss_elimination_method_to_solve_linear_algebraic_equations

Preview meta tags from the math.answers.com website.

Linked Hostnames

9

Thumbnail

Search Engine Appearance

Google

https://math.answers.com/calculus/C_program_for_gauss_elimination_method_to_solve_linear_algebraic_equations

C program for gauss elimination method to solve linear algebraic equations? - Answers

#include"stdio.h" #include"conio.h" #include"math.h" void main() { int i,j; float a[3][4],b[3][4],c[4][4]; float x,y,z,p,q,r; m: printf("\nEnter the coefficients: "); for(i=0;i<3;i++) for(j=0;j<3;j++) scanf("%f",&a[i][j]); printf("\nEnter the constants: "); for(i=0;i<3;i++) scanf("%f",&a[i][3]); if(a[0][0]!=0.0) { p=a[1][0]; q=a[0][0]; r=a[2][0]; for(j=0;j<=3;j++) { b[0][j]=-(p/q)*a[0][j]; a[1][j]+=b[0][j]; c[0][j]=-(r/q)*a[0][j]; a[2][j]+=c[0][j]; } p=a[2][1]; q=a[1][1]; for(j=0;j<=3;j++) { b[1][j]=-(p/q)*a[1][j]; a[2][j]+=b[1][j]; } printf("\n\nThe matrix becomes\n"); for(i=0;i<3;i++) { for(j=0;j<4;j++) { printf("%.4f\t",a[i][j] } printf("\n"); } z=a[2][3]/a[2][2]; y=(a[1][3]-a[1][2]*z)/a[1][1]; x=(a[0][3]-a[0][2]*z-a[0][1]*y)/a[0][0]; printf("\nThe solution is"); printf("\nX=%f, Y=%f , Z=%f",x,y,z); } else { printf("\nThe first cofficient must not be zero,Enter again"); goto m; } }



Bing

C program for gauss elimination method to solve linear algebraic equations? - Answers

https://math.answers.com/calculus/C_program_for_gauss_elimination_method_to_solve_linear_algebraic_equations

#include"stdio.h" #include"conio.h" #include"math.h" void main() { int i,j; float a[3][4],b[3][4],c[4][4]; float x,y,z,p,q,r; m: printf("\nEnter the coefficients: "); for(i=0;i<3;i++) for(j=0;j<3;j++) scanf("%f",&a[i][j]); printf("\nEnter the constants: "); for(i=0;i<3;i++) scanf("%f",&a[i][3]); if(a[0][0]!=0.0) { p=a[1][0]; q=a[0][0]; r=a[2][0]; for(j=0;j<=3;j++) { b[0][j]=-(p/q)*a[0][j]; a[1][j]+=b[0][j]; c[0][j]=-(r/q)*a[0][j]; a[2][j]+=c[0][j]; } p=a[2][1]; q=a[1][1]; for(j=0;j<=3;j++) { b[1][j]=-(p/q)*a[1][j]; a[2][j]+=b[1][j]; } printf("\n\nThe matrix becomes\n"); for(i=0;i<3;i++) { for(j=0;j<4;j++) { printf("%.4f\t",a[i][j] } printf("\n"); } z=a[2][3]/a[2][2]; y=(a[1][3]-a[1][2]*z)/a[1][1]; x=(a[0][3]-a[0][2]*z-a[0][1]*y)/a[0][0]; printf("\nThe solution is"); printf("\nX=%f, Y=%f , Z=%f",x,y,z); } else { printf("\nThe first cofficient must not be zero,Enter again"); goto m; } }



DuckDuckGo

https://math.answers.com/calculus/C_program_for_gauss_elimination_method_to_solve_linear_algebraic_equations

C program for gauss elimination method to solve linear algebraic equations? - Answers

#include"stdio.h" #include"conio.h" #include"math.h" void main() { int i,j; float a[3][4],b[3][4],c[4][4]; float x,y,z,p,q,r; m: printf("\nEnter the coefficients: "); for(i=0;i<3;i++) for(j=0;j<3;j++) scanf("%f",&a[i][j]); printf("\nEnter the constants: "); for(i=0;i<3;i++) scanf("%f",&a[i][3]); if(a[0][0]!=0.0) { p=a[1][0]; q=a[0][0]; r=a[2][0]; for(j=0;j<=3;j++) { b[0][j]=-(p/q)*a[0][j]; a[1][j]+=b[0][j]; c[0][j]=-(r/q)*a[0][j]; a[2][j]+=c[0][j]; } p=a[2][1]; q=a[1][1]; for(j=0;j<=3;j++) { b[1][j]=-(p/q)*a[1][j]; a[2][j]+=b[1][j]; } printf("\n\nThe matrix becomes\n"); for(i=0;i<3;i++) { for(j=0;j<4;j++) { printf("%.4f\t",a[i][j] } printf("\n"); } z=a[2][3]/a[2][2]; y=(a[1][3]-a[1][2]*z)/a[1][1]; x=(a[0][3]-a[0][2]*z-a[0][1]*y)/a[0][0]; printf("\nThe solution is"); printf("\nX=%f, Y=%f , Z=%f",x,y,z); } else { printf("\nThe first cofficient must not be zero,Enter again"); goto m; } }

  • General Meta Tags

    22
    • title
      C program for gauss elimination method to solve linear algebraic equations? - Answers
    • charset
      utf-8
    • Content-Type
      text/html; charset=utf-8
    • viewport
      minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no
    • X-UA-Compatible
      IE=edge,chrome=1
  • Open Graph Meta Tags

    7
    • og:image
      https://st.answers.com/html_test_assets/Answers_Blue.jpeg
    • og:image:width
      900
    • og:image:height
      900
    • og:site_name
      Answers
    • og:description
      #include"stdio.h" #include"conio.h" #include"math.h" void main() { int i,j; float a[3][4],b[3][4],c[4][4]; float x,y,z,p,q,r; m: printf("\nEnter the coefficients: "); for(i=0;i<3;i++) for(j=0;j<3;j++) scanf("%f",&a[i][j]); printf("\nEnter the constants: "); for(i=0;i<3;i++) scanf("%f",&a[i][3]); if(a[0][0]!=0.0) { p=a[1][0]; q=a[0][0]; r=a[2][0]; for(j=0;j<=3;j++) { b[0][j]=-(p/q)*a[0][j]; a[1][j]+=b[0][j]; c[0][j]=-(r/q)*a[0][j]; a[2][j]+=c[0][j]; } p=a[2][1]; q=a[1][1]; for(j=0;j<=3;j++) { b[1][j]=-(p/q)*a[1][j]; a[2][j]+=b[1][j]; } printf("\n\nThe matrix becomes\n"); for(i=0;i<3;i++) { for(j=0;j<4;j++) { printf("%.4f\t",a[i][j] } printf("\n"); } z=a[2][3]/a[2][2]; y=(a[1][3]-a[1][2]*z)/a[1][1]; x=(a[0][3]-a[0][2]*z-a[0][1]*y)/a[0][0]; printf("\nThe solution is"); printf("\nX=%f, Y=%f , Z=%f",x,y,z); } else { printf("\nThe first cofficient must not be zero,Enter again"); goto m; } }
  • Twitter Meta Tags

    1
    • twitter:card
      summary_large_image
  • Link Tags

    16
    • alternate
      https://www.answers.com/feed.rss
    • apple-touch-icon
      /icons/180x180.png
    • canonical
      https://math.answers.com/calculus/C_program_for_gauss_elimination_method_to_solve_linear_algebraic_equations
    • icon
      /favicon.svg
    • icon
      /icons/16x16.png

Links

58