# problem using

 Arnab Banerjee · June 16, 2015 namespace program1{    class Program    {        static void Main(string[] args)        {            string number;            Console.WriteLine("Please enter your lucky number (With in the range of 50) ");            number = Console.ReadLine();            int x = int.Parse(number);                       string message = "";                       if (x <= 10)            {                if (x % 3 == 0)                                    message = "You won a cricket bat";                                else                     message = "you haven't won anything";            }            if(11 <=x <= 20)            {                message = "you won a cricket ball ";            }            Console.WriteLine(message);            Console.ReadLine();        }    }}I got the problem in bold &  underlined line (line o. 23)

## Replies

 mike richardson · June 16, 2015 Not sure what you are trying to do on line 23 but here are some suggestions.if(x <= 11 && x <= 20) ariel bitan · June 16, 2015 You are writing an expressions so you can't do 1<=x<=20 you need to do like Mike Richardson said mike richardson · June 16, 2015 NP Cardinal Coog · June 16, 2015 I think what he is trying to do is check if x is between 11 and 20 inclusive.If so, he should use:if(x >= 11 && x <= 20){} Arnab Banerjee · June 16, 2015 Thanks mike & ariel Arnab Banerjee · June 17, 2015 yeah thanks cardinal,, the problem is solved no.
• 1

## C#

129,935 followers