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)"
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”);
}
}
}
}