help !!! using ultrasonic sensor in a loop , for people counter

I am using ultrasonic sensors to creat people counter ,,

like I am using two ultrasonic sensors ,

In case if the distance in the first one is less than 30 cm .. and ((then )) the second one is also less than 30 cm ,, it have to give { C=C+1 }

In case if the distance in the fsecound one is less than 30 cm .. and ((then )) the first one is also less than 30 cm ,, it have to give { C=C-1 } ,, and display it in the seven sigma ,,

and I joined a gas sensor with the project to detect the smock in the room

I am having a problem with the loop that counts the number of people ,,

I need help as soon as possible ,, pllllzzzz

the_whoke_programm.ino (2.86 KB)

and I joined a gas sensor with the project to detect the smock in the room

How does a gas sensor detect smocks?

 // int C means the number of people inside the room ,, initially  equalls to zero  
 int C =0;

Then, why in heavens name don't you use a reasonable name? peopleInRoom wouldn't need a useless comment.

You would need to post a diagram showing how the sensors are aimed, so that your description makes sense.

Your inconsistent indenting and inconsistent placement of { and } (sometimes on new lines; sometimes on the same line as a statement) makes following the code quite difficult. And, I suspect that this is the heart of your problem.

Put every { and every } on a line all by itself. Use Tools + Auto Format.

Sometimes delaying by 80 milliseconds, and sometimes not, is weird.