Blinking 2 LED having input from serial monitor
@Juraj was on the right track however the end-of-line characters for example may not be buffered and the problem could continue.  

The correct approach is the wait for the end-of-line character specifically.  Let's take the easy way out and use Serial.readStringUntil

#define EOL_CHAR '\n'

void setup() {
  Serial.begin(9600);
  pinMode(REDledpin,OUTPUT);
  pinMode(YELledpin,OUTPUT);

  Serial.println("How much voltage you want to apply to the red LED (0-255)?");
  while(Serial.available()==0){}
  redintensity= Serial.parseInt();

  Serial.readStringUntil(EOL_CHAR); // clear serial buffer to end of line character

  Serial.println("How much voltage you want to apply to the yellow LED (0-255)?");
  while(Serial.available()==0){}
  yellowintensity = Serial.parseInt(); 

}


This all depends on what you're Serial Monitor is sending as a new line; it could be CR (\r), LF (\n) or CRLF (\r\n), so change the EOL_CHAR value accordingly depending on your serial monitor setup.