0
How do you display output in the console window on SoloLearn in the C# language?
19 Respuestas
+ 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));
+ 1
I'm going to try it as it is and give you feedback
+ 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?
+ 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.
+ 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.
+ 1
Yes I am.
0
Run the program? That is what I always do.
0
It gives me errors. In VS(Visual Studio) I'd use Console.WriteLine(); but it doesn't seem to work on SoloLearn.
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?
0
Will you make some code public, so I can try it myself?
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?
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.
0
If you have only one input you can ignore it.
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.
0
Are you a self-taught just as most of us are?
0
And how are you finding it so far?
0
I like it, it is not that difficult. But I intended to learn Python, and that is what I am going to do.
0
And I am waiting for Sololearn to start with new languages.
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.