Application won't compile with an error

I am doing the exercise in the C# course, at the control flow module.
the code is:

using System;
using controlflow;

namespace controlflow
{
public class Conditionals
{
static void main()
public void Execrcise1()
{
Console.WriteLine( “Enter a number between 1 to 10:”);
var input = Console.ReadLine();
var number = Convert.ToInt32(input);
if (number >= 1 && number<= 10)
Console.WriteLine(“valid”);
else
Console.WriteLine(“invalid”);
}
}
}

When I run the console application I get an error " CS5001: Program does not contain a static ‘Main’ method suitable for an entry point (CS5001) (Conditionals)"

Can anyone help out?

How about to try this way:

using System;
using controlflow;

namespace controlflow
{
public class Conditionals
{
private static void Main()
{
Console.WriteLine(“Enter a number between 1 to 10:”);
var input = Console.ReadLine();
var number = Convert.ToInt32(input);
if (number >= 1 && number <= 10)
{
Console.WriteLine(“valid”);
}
else
{
Console.WriteLine(“invalid”);
}
}
}
}

Hi Harisn, I added the private static statement at compile I get this error
image

Hi
Your code is faulty.

This is how it appears in VS Code after a first pass of indenting

image

This cannot work.

You input 2 method signatures for only one scope.

Where is the main() method body?
What about Execrcise1()?

I made an example of your code working @.NET Fiddle.

Cheers

@UniqueNospaceShort Thank you that has worked. appreciate your help.