-1

Okay So I work visual c# when i want to put this line

enter code here




static void Main(string[] args)
        {
            Console.ReadLine a, b, c, max;

        }
    }
}

but it says this error about the ReadLine part: The type name "ReadLine" does not exist in the type 'Console'

5
  • What should I do about it? Commented Jul 9, 2016 at 17:39
  • looks like you have already asked the same question in Java. What's your final goal here? learning both? Commented Jul 9, 2016 at 17:50
  • @Rahul That was for a very long time ago and i wasn't learning java serious but i'm learning this one more serious and man you're stubborn xD ;) Commented Jul 9, 2016 at 17:53
  • Can anyone tell me how to use this command for int numbers? i want to get a program that gets numbers and tells you which one is higher i just need help for the input part. Commented Jul 9, 2016 at 17:56
  • You need to convert the data to INT type. Start reading documentation ... by asking question no one learns. Commented Jul 9, 2016 at 18:02

2 Answers 2

2

Console.ReadLine is a method, so it should be used like this:

Console.WriteLine("Enter something"); //this will print the text to the screen
string inputText = Console.ReadLine(); // Get string from the input and assign it to the inputText variable

You can see an additional reference here.

Sign up to request clarification or add additional context in comments.

Comments

2

What's This??? Go and read MSDN documentation first. The error is cause ReadLine() is a method but you are trying to use it as a type by itself. It should just be below assuming you have already declared a variable named a and it's of type string.

a = Console.ReadLine();

Read Console.ReadLine Method (). documentation has few good examples which will help in clear your doubts.

1 Comment

@user3607864, consider accepting the answer if it's helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.