### How to find the difference between each iteration level

Hi,

I'm writing a code for a type of numerical method solution. I got stuck at a point of implementing the check expression while the iteration is carried out in the program. The objective of the present problem is that I have to stop iterations from moving ahead and should display result. Help me in with the desirable syntax and structure of the loop that I need to follow in achieving my result.
The problem has to be fixed at the end by fixing it with necessary syntax and structure of loop.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899`` ``````#include #include #include using namespace std; int main() { /*Grid Point declarations*/ int x,y; double dx,dy; double left,right,top,bottom; double a[100][100]; double phi[100][100],uphi[100][100]; cout<<"Enter no. of grid points"<>x; cout<<"y:"; cin>>y; cout<<"Enter Grid Size"<>dx; cout<<"dy:"; cin>>dy; /*Read & Define Boundary Conditions*/ cout<>left; for (int i=0;i<=x-1;i++) { phi[0][i]=left; } cout<>right; for (int i=0;i<=x-1;i++) { phi[x-1][i]=right; } cout<>top; for (int i=0;i<=x-1;i++) { phi[i][y-1]=top; } cout<>bottom; for (int i=0;i<=x-1;i++) { phi[i][0]=bottom; } cout<<'\n'; cout<<"First Iteration values"<>nit; cout<<'\n'; for (int it=2;it<=nit;it++) { for (int i=1;i<=x-2;i++) { for(int j=1;j<=y-2;j++) { phi[i][j]=(phi[i+1][j]+phi[i-1][j]+phi[i][j+1]+phi[i][j-1])/4; cout<