+ 1

Error that i cant understand in c#

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { Console.WriteLine("Please put in number that you want to convert"); double number = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Number 1: feet to cm. Number 2: cm to feet"); System.Threading.Thread.Sleep(10000); int select = Convert.ToInt32(Console.ReadLine()); if(select = 1) Console.WriteLine(number * 30); else Console.WriteLine(number / 30); } } } this code gives me a error. i dont know why it does

14th Sep 2018, 2:48 PM
KnockKnock
KnockKnock - avatar
1 Réponse
+ 2
You write a mistake: if(select=1) you should use == instead of =
14th Sep 2018, 3:22 PM
Yaser Parsa
Yaser Parsa - avatar