0

How do you display output in the console window on SoloLearn in the C# language?

28th Aug 2017, 11:10 AM
Tshego M
Tshego M - avatar
19 Respostas
+ 1
I have cut this from a program of nu won, it works: Console.WriteLine("Give a number, lets calculate the factorial!"); int number = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Number {0} is the factorial you looked for.", Factorial(number));
28th Aug 2017, 11:19 AM
Paul
Paul - avatar
+ 1
I'm going to try it as it is and give you feedback
28th Aug 2017, 11:26 AM
Tshego M
Tshego M - avatar
+ 1
PJ, it keeps telling me that the code needs input then proceeds to throw errors during runtime. Everything looks right to me. What am I missing?
28th Aug 2017, 11:34 AM
Tshego M
Tshego M - avatar
+ 1
In Sololearn, you have to give all you input at the same time. If you have three values do : one two three and then push the input button. You separate input with the return key. It is not interactive.
28th Aug 2017, 11:40 AM
Paul
Paul - avatar
+ 1
I am glad I could help. And I don't know the answer to your new question. I normally use Google in that case.
28th Aug 2017, 1:24 PM
Paul
Paul - avatar
+ 1
Yes I am.
28th Aug 2017, 1:27 PM
Paul
Paul - avatar
0
Run the program? That is what I always do.
28th Aug 2017, 11:12 AM
Paul
Paul - avatar
0
It gives me errors. In VS(Visual Studio) I'd use Console.WriteLine(); but it doesn't seem to work on SoloLearn.
28th Aug 2017, 11:14 AM
Tshego M
Tshego M - avatar
0
Console.WriteLine("Hello world!"); <- PJ, this is what I type and I get an error. I type everything within the Main method and still I get errors. What am I doing wrong?
28th Aug 2017, 1:03 PM
Tshego M
Tshego M - avatar
0
Will you make some code public, so I can try it myself?
28th Aug 2017, 1:06 PM
Paul
Paul - avatar
0
Well it seems to have worked. I think I forgot the semicolon at the end, silly me. What does it mean when it says I need to split input into multiple lines?
28th Aug 2017, 1:07 PM
Tshego M
Tshego M - avatar
0
I have answered that already. You give all you're input at the same time, each input on a new line. There is no normal dialog possible.
28th Aug 2017, 1:11 PM
Paul
Paul - avatar
0
If you have only one input you can ignore it.
28th Aug 2017, 1:12 PM
Paul
Paul - avatar
0
I've succeeded. Thanks for your patience. It's my first time using the coding function, so do forgive my ignorance. I'm trying to format my currency to show R(Rands) instead of $(Dollars). Do you know how to create a custom format? {0:C} is for currency that much I do know.
28th Aug 2017, 1:20 PM
Tshego M
Tshego M - avatar
0
Are you a self-taught just as most of us are?
28th Aug 2017, 1:26 PM
Tshego M
Tshego M - avatar
0
And how are you finding it so far?
28th Aug 2017, 1:29 PM
Tshego M
Tshego M - avatar
0
I like it, it is not that difficult. But I intended to learn Python, and that is what I am going to do.
28th Aug 2017, 1:33 PM
Paul
Paul - avatar
0
And I am waiting for Sololearn to start with new languages.
28th Aug 2017, 1:35 PM
Paul
Paul - avatar
0
I haven't delved into Python before but perhaps I'll get around to doing it. I want to learn Java, SQL and C# because they're the ones in demand.
28th Aug 2017, 1:50 PM
Tshego M
Tshego M - avatar