How to combine two codes in arduino?
While I'd like to direct you to ways to set up a nice tasking system with a frame counter, your system is likely simple enough that it is unnecessary.  You can likely just replace the delay(1000); of the second program with approximately 5 calls of the first program's loop.  May you instead learn something when cleaning up the following (which is literally a copy paste with minimal changes).

#include &lt;LiquidCrystal.h&gt;
LiquidCrystal lcd(12,11,5,4,3,2);

#define sensor A0 
#define led 13  
#define ledd 8  // d out from mq3 
#define buz 9   
#define motor 10 
void setup1() 
{
  Serial.begin(9600);
  lcd.begin(16,2);
  lcd.print(&quot;ALCOHOL MONITORING&quot;); 
  lcd.setCursor(0,1);
  lcd.print(&quot; VEHICLE SYSTEM &quot;);
  delay(2000);
  pinMode(sensor, INPUT); 
  pinMode(buz, OUTPUT); 
  pinMode(led, OUTPUT);  
  pinMode(ledd, OUTPUT); 
  pinMode(motor, OUTPUT); 
  lcd.clear();
}

void loop1() 
{
  float adcValue=0;
  for(int i=0;i&lt;10;i++)
  {
    float actualanalogReading =  analogRead(sensor); 
    adcValue = adcValue + actualanalogReading; 
    Serial.println(&quot;In loop counter &gt;&quot;); // logging
    Serial.print(i);
    Serial.print(&quot; input reading : &quot;);
    Serial.print(actualanalogReading);  
    Serial.print(&quot; cumulative input reading : &quot;);
    Serial.print(adcValue);  
    
    delay(10);
  }
    float v= (adcValue/10) * (3.0/1024.0); 
    float mgL= 0.67 * v;
    Serial.println(&quot;&quot;);
    Serial.print(&quot;Post calculation v value &gt;&quot; );
    Serial.print(v);
    Serial.print(&quot; mg/L &gt; &quot;);
    Serial.print(mgL);  
    Serial.println(&quot;&quot;);
    Serial.print(&quot;BAC:&quot;); 
    Serial.print(mgL);
    Serial.print(&quot; mg/L&quot;); 
    lcd.setCursor(0,0);
    lcd.print(&quot;BAC: &quot;); 
    lcd.print(mgL,4);
    lcd.print(&quot; mg/L        &quot;); 
    lcd.setCursor(0,1);
    if(mgL &gt; 0.8)   
    { 
      lcd.print(&quot;Drunk ENGINE OFF &quot;);   
      Serial.println(&quot;Drunk ENGINE OFF &quot;);  
      digitalWrite(buz, HIGH);
      digitalWrite(led, HIGH);
      digitalWrite(ledd, LOW);
      digitalWrite(motor, LOW);
    }
    else  
    {
      lcd.print(&quot;Normal ENGINE ON &quot;); 
      Serial.println(&quot; Normal ENGINE ON &quot;); 
      digitalWrite(buz, LOW);
      digitalWrite(led, LOW);
      digitalWrite(ledd, HIGH);
      digitalWrite(motor, HIGH);
    }

    delay(100);
    
}

const int LED = A5; 
const int DO = 6; 
void setup() { 
 setup1(); //Serial.begin(9600);
 pinMode(LED, OUTPUT); 
 pinMode(DO, INPUT); 
} 
void loop() { 
 int alarm = 0; 
 float sensor_volt; 
 float RS_gas; 
 float ratio; 
//-Replace the name &quot;R0&quot; with the value of R0 in the demo of First Test -/ 
 float R0 = 0.10; 
 int sensorValue = analogRead(A1); 
 sensor_volt = ((float)sensorValue / 1024) * 5.0; 
RS_gas = (5.0 - sensor_volt) / sensor_volt; // Depend on RL on yor module 
 ratio = RS_gas / R0; // ratio = RS/R0 
//------------------------------------------------------------/ 
 Serial.print(&quot;sensor_volt = &quot;); 
 Serial.println(sensor_volt); 
 Serial.print(&quot;RS_ratio = &quot;); 
 Serial.println(RS_gas); 
 Serial.print(&quot;Rs/R0 = &quot;); 
 Serial.println(ratio); 
 Serial.print(&quot;\n\n&quot;); 
 alarm = digitalRead(DO); 
 if (alarm == 1) digitalWrite(LED, LOW); 
 else if (alarm == 0) digitalWrite(LED, HIGH); 

 for(int dd = 0; dd &lt; 5; dd++) loop1();
}