C++ Program to Implement Gauss-Seidel Method

In this program, we are going to share a C++ Program to Implement Gauss-Seidel Method with the output. If you are a beginner and want to start learning the C++ programming, then keep your close attention in this tutorial as I am going to share a program for C++ Program to Implement Gauss-Seidel Method.

C++ Program to Implement Gauss Seidel Method with the output

Copy the below C++ program and execute it with the help of GCC compiler. At the end of this program, We have shared the output of this program.

Program Output

Enter size of 2d array(Square matrix) : 3
Enter values no :(0, 0) 2
Enter values no :(0, 1) 3
Enter values no :(0, 2) 1
Enter values no :(1, 0) 5
Enter values no :(1, 1) 4
Enter values no :(1, 2) 6
Enter values no :(2, 0) 8
Enter values no :(2, 1) 7
Enter values no :(2, 2) 9
Enter Values to the right side of equation
Enter values no :(0, 3) 2
Enter values no :(1, 3) 3
Enter values no :(2, 3) 4
Enter initial values of x
Enter values no. :(0): 0
Enter values no. :(1): 0
Enter values no. :(2): 0
Enter the no. of iteration : 4
x1 = 1.000000 x2 = -0.500000 x3 = -0.055556
x1 = 1.777778 x2 = -1.388889 x3 = -0.055556
x1 = 3.111111 x2 = -3.055555 x3 = 0.055555
x1 = 5.555555 x2 = -6.277777 x3 = 0.388889

Recommended Posts:


Editorial Staff

Editorial Staff at FreeWebMentor is a team of professional developers.


2 thoughts on “C++ Program to Implement Gauss-Seidel Method”

  1. ye tumne last me printf kyo type kiya hai ye to c langauge me hona tha

    why are you type ( printf ) in the last of the program I think there will be ( cout )

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.