Ask coding questions

← Back to all posts
CS1525: Unexpected symbol `}'
h
LukasTrisauskas (0)

I can't seem to locate the problem. Can anyone else take a look, maybe you can find it.

Thank you.

Comments
hotnewtop
Coder100 (18123)

Your for loop is invalid. You forgot to add a ; at the end. Every for loop requires 2 ;, even if you don't think it does

using System;

class MainClass
{
  public static void Main (string[] args) 
  {
    int n = 10;
    for(int i = 2; i <= n; i++) 
    {
      for(int j = 0; j <= n;) 
      {
        Console.WriteLine(i, j);
        j = j + (n / 4);
      }
    }
  }
}
OldWizard209 (1529)

ummmm @LukasTrisauskas it is a private repl. Pls change it to public so we can see the code or just past the code.

LukasTrisauskas (0)

@OldWizard209 Sorry about that. It should appear now.

OldWizard209 (1529)

I can't seem to find the problem either... Ask on SO. @LukasTrisauskas

LukasTrisauskas (0)

@OldWizard209 Sorry to ask, but what is SO. I'm kind of new to repl.