Can two for loops be used in one void loop

Controlling two stepper motors using for loops controlled by processing

I want these two for loops to run one after another, will they run ??? > Blockquote

void loop(){
if (Serial.available()>0) { // If data is available to read,
char val = Serial.read(); // read it and store it in val
delay(40);
if(val == 'r') //if we get a r
{
for (int i = 0; i < stepsPerRevolution; i++) {
// These four lines result in 1 step:

      digitalWrite(stepPin, HIGH);
      delayMicroseconds(50);
      digitalWrite(stepPin, LOW);
      delayMicroseconds(50);}
   // Set the spinning direction clockwise:

val = analogRead(potPin);
delayValue = (val*2)+500;
// Spin the stepper motor 1 revolution slowly:
for (int i = 0; i < stepsPerRevolution; i++) {
// These four lines result in 1 step:
//switchvalue = digitalRead(pin); switch check on serial monitor code
digitalWrite(stepPin, HIGH);
delayMicroseconds(delayValue);
digitalWrite(stepPin, LOW);
delayMicroseconds(delayValue);
//Serial.println(switchvalue);

}
}

If you type CTRL-T in the Arduino IDE, the formatting and indentation will reveal the loop nesting. You can write as many for loops as you think necessary, nested or sequential.

Please use code tags when posting, so your code looks like this:

void loop() {
  if (Serial.available() > 0) { // If data is available to read,
    char val = Serial.read(); // read it and store it in val
    delay(40);
    if (val == 'r') //if we get a r
    {
      for (int i = 0; i < stepsPerRevolution; i++) {
        // These four lines result in 1 step:

        digitalWrite(stepPin, HIGH);
        delayMicroseconds(50);
        digitalWrite(stepPin, LOW);
        delayMicroseconds(50);
      }
      // Set the spinning direction clockwise:

      val = analogRead(potPin);
      delayValue = (val * 2) + 500;
      // Spin the stepper motor 1 revolution slowly:
      for (int i = 0; i < stepsPerRevolution; i++) {
        // These four lines result in 1 step:
        //switchvalue = digitalRead(pin); switch check on serial monitor code
        digitalWrite(stepPin, HIGH);
        delayMicroseconds(delayValue);
        digitalWrite(stepPin, LOW);
        delayMicroseconds(delayValue);
        //Serial.println(switchvalue);

      }
    }

Hint: the keyword "void" means here that the function named loop() does not return a value.