Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Basics Methods Defining a Method

C# Code Challenge

Goodnight night everyone,

Any help rendered would be appreciated. Could you tell me what is wrong with my code? Thanks

Program.cs
using System;

class Program
{

    static void Spell();
    {
        Console.WriteLine("c");
        Console.WriteLine("a");
        Console.WriteLine("t");
    }    

    static void Main(string[] args)
    {
        Spell();
    }
}

2 Answers

Libby Exley
Libby Exley
9,462 Points

Your code is correct apart from the semicolon on the end when defining the spell method. A method has curly braces following the line so does not need the semic colon on the end. (Look at the end of the Main method) e.g.

static void Spell()
{
    Console.WriteLine("c");
    Console.WriteLine("a");
    Console.WriteLine("t");
}

Thank you very much libby was very helpful