expected initializer before 'int'.

void setup()
{
Serial.begin(9600); //Set serial baud rate to 9600 bps
pinMode (10,OUTPUT);
}
void loop ()
int (valGas , valLDR) ;
valGas = analogRead(0);
valLDR = analogRead(1);

Serial.println(valGas,DEC);
Serial.print (",");
Serial.println in(valLDR,DEC);

if(valGas<600) {
digitalWrite (10,High);
} else }
digitalWrite (10,Low);
}
if (valLDR<400) {
digitalWrite(11,High);
} else }
digitalWrite(11,Low);
}
delay (100) ;
}

i get error when i want to compile this code..can anybody help me to see what is wrong with my code?

void setup()
{
  Serial.begin(9600); //Set serial baud rate to 9600 bps
  pinMode (10,OUTPUT);
}
void loop ()
  int (valGas , valLDR) ;
    valGas = analogRead(0);
    valLDR = analogRead(1);
 
  Serial.println(valGas,DEC);
  Serial.print (",");
  Serial.println in(valLDR,DEC);
 
 if(valGas<600) {
    digitalWrite (10,High);
  } else }
     digitalWrite (10,Low);
   }
 if (valLDR<400) {
   digitalWrite(11,High);
 } else }
   digitalWrite(11,Low);
   }
  delay (100) ;
  }

makes it easier to read

try

int valGas;
int valLDR;

or

int valGas , valLDR ;

no brackets!

sorry, my bad.

i try both ways..but still error.

you also need

void loop 
{
... your code
}

you left out the "{" and "}"

  Serial.println(valgas,DEC);
  Serial.print (",");
  Serial.println(valLDR,DEC);

is this part right?

if(valGas<600) {
    digitalWrite (10,High);
  } else }
     digitalWrite (10,Low);
   }
 if (valLDR<400) {
   digitalWrite(11,High);
 } else }
   digitalWrite(11,Low);
   }
  delay (100) ;
  }

is this the right way to write if-else statement?

is this part right?

If you want that extra carriage return/line feed in the middle, yes. Seems strange to me, though.

is this the right way to write if-else statement?

Sort of. The braces are not all facing the right way, and they are not all on separate lines where they belong (in my opinion).

if(valGas<600)
{
    digitalWrite (10,High);
}
else
{
   digitalWrite (10,Low);
}
void setup()
{
  Serial.begin(9600); //Set serial baud rate to 9600 bps
  pinMode (10,OUTPUT);
}
void loop ()
{
  int valgas , valLDR;
    valgas = analogRead(0);
    valLDR = analogRead(1);

  Serial.println(valgas,DEC);
  Serial.print (",");
  Serial.println (valLDR,DEC);
}
 if(valGas<600)
{
    digitalWrite (10,High);
}
else
{
   digitalWrite (10,Low);
}
 if (valLDR<400) 
{
   digitalWrite(11,High);
} 
else 
{
   digitalWrite(11,Low);
   }
  delay (100) ;
  }

this is my current coding,
however, i still got error at this part

 if(valGas<600)
{
    digitalWrite (10,High);
}
else
{
   digitalWrite (10,Low);
}
 if (valLDR<400) 
{
   digitalWrite(11,High);
} 
else 
{
   digitalWrite(11,Low);
   }
  delay (100) ;
  }

look at you code
you have { and } all over the place

you should have

void loop()
{
  .. all of your code
  if (condition)
  {
    .. true code
  }
  else
  {
    ... false code
  }
}

use indents to help you keep track
and check matching { and }

The IDE has a menu, Tools. On that menu, there is an item, Auto Format. Do your self a favor. Use that tool. Often. It will fix all your random indents. It will also line up all your curly braces, indenting in and out as required. When it gets to the end of a function, and there are still closing } left over, they will bot be indented, leaving you a big clue that the number of open and close braces don't match.

ALL code needs to be inside a function. Not all of yours is. Why not?