PLS HELP FOR DIY WATER LEVEL SENSOR CODE

does anyone how to code a diy water level using only wires
i tried using this code but it doesnt seem to work

int a=0;
int b=0;
int c=0;


void setup(){

pinMode(A4,INPUT);

pinMode(A3,INPUT);

pinMode(A2,INPUT);

Serial.begin(9600);

}

void loop()

{ int r=digitalRead(A4);

int s=digitalRead(A3);

int t=digitalRead(A2);



if(r==HIGH && s==LOW && t==LOW)

{ if(a==0)



Serial.print("Level 1 "); 
delay(500);



a++; b=0; c=0;

}


if(r==HIGH && s==HIGH && t==LOW)

{ if(b==0)



Serial.print("Water at Level 2 ");

//the message you want to send



b++; a=0; c=0;

} 

if(r==HIGH && s==HIGH && t==HIGH) { if(c==0)


Serial.print("Water at Level 3 ");



c++; b=0; a=0; } 

else

{ Serial.print("Circuit Not Connected");

}

}

any help will be much apprecieated

Hello
Welcome to the Arduino fora.
Before you do anything else please take a moment to read General guidance
And
How to use this forum
Especially item #7 on posting code.

Thank you

You didn’t say what “working” means.
The code does something, so describe that.

Don’t use single letters as variable names, and try to use a consistent indentation style.

it just repeatedly spams "circuit not connected" in the serial monitor

And is the unspecified circuit connected?

yes

Ok.
I guess we’ll just have to take your word that the still unspecified circuit is connected.

Good luck.

Please post a schematic (hand drawn and photographed is OK) of your project

Here is your code Auto Formatted in the IDE

int a = 0;
int b = 0;
int c = 0;

void setup()
{
  pinMode(A4, INPUT);
  pinMode(A3, INPUT);
  pinMode(A2, INPUT);
  Serial.begin(9600);
}

void loop()

{
  int r = digitalRead(A4);
  int s = digitalRead(A3);
  int t = digitalRead(A2);
  if (r == HIGH && s == LOW && t == LOW)
  {
    if (a == 0)
      Serial.print("Level 1 ");
    delay(500);
    a++;
    b = 0;
    c = 0;
  }
  if (r == HIGH && s == HIGH && t == LOW)
  {
    if (b == 0)
      Serial.print("Water at Level 2 ");
    //the message you want to send
    b++;
    a = 0;
    c = 0;
  }
  if (r == HIGH && s == HIGH && t == HIGH)
  {
    if (c == 0)
      Serial.print("Water at Level 3 ");
    c++;
    b = 0;
    a = 0;
  }
  else
  {
    Serial.print("Circuit Not Connected");
  }
}

The indentation makes it much clearer which code is dependant on the tests and which will be executed unconditionally.

As a general rule it is best to enclose conditional code blocks in { and } even if there is only one conditional statement. A useful technique is to print the values being tested immediately before the test to see which parts of the code are being executed and the value of pertinent variables