Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How to use threading in the online compiler?

+2 votes
asked May 26, 2021 by Justice Cother (140 points)

using System;

class HelloWorld 
{
  static void Main()
  {
    string intro="Hello World"
    
        for(int i=0;i<intro.Length;i++);
    {
        System.Console.WriteLine(intro[i])
        
        System.Threading.Thread.Sleep(50);
    }
  }
}

I believe this should type each letter like a typewriter.
The above code starts at line 9.

I am getting these errors:

main.cs(17,8): error CS1525: Unexpected symbol `for'
main.cs(17,38): error CS1525: Unexpected symbol `)', expecting `;' or `}'

1 Answer

0 votes
answered Jan 2, 2022 by xDELLx (10,500 points)
Please correct syntax errors:

string intro="Hello World" , need ';' at end of Line

  for(int i=0;i<intro.Length;i++); , loose the ';' at end of line (not syntax error , but logical error)

  System.Console.WriteLine(intro[i]) , add ; at end of line
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...