c# What is wrong here??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
8th Dec 2021, 12:42 AM
Bob Bob
13 Answers
+ 4
You are passing a lesson on converting a string variable to a finishing variable and you were given an example. Let's say you need to do some kind of mathematical calculation with the "x" variable.
8th Dec 2021, 3:14 AM
Solo
Solo - avatar
+ 2
Output: Console.WriteLine(n);
8th Dec 2021, 1:02 AM
Solo
Solo - avatar
0
You should print the output, add this line: Console.WritleLine(n);
8th Dec 2021, 1:05 AM
Parsazfi
Parsazfi - avatar
0
Okay, thanks that helped I have another question though:
8th Dec 2021, 1:34 AM
Bob Bob
0
Whats the point of doing all of that when I can just do: string n = “77”; Console.WriteLine (n);
8th Dec 2021, 1:36 AM
Bob Bob
0
Hmm, I'm not exactly sure what you mean, it's not wrong!
8th Dec 2021, 1:43 AM
Parsazfi
Parsazfi - avatar
0
Like why do I have to say: double n; string x = “77”; n = Console.ToDouble (x) Console.WriteLine (n); When I could just say: string x = “77” Console.WriteLine (x);
8th Dec 2021, 2:24 AM
Bob Bob
0
I know but whats the point of writing 4 lines when i could write 2?
8th Dec 2021, 3:11 AM
Bob Bob
0
It makes no sense
8th Dec 2021, 3:11 AM
Bob Bob
0
There is nothing
9th Dec 2021, 11:38 AM
Gourav raghuwanshi
Gourav raghuwanshi - avatar
- 1
Yes, i just want to know the use of it though
8th Dec 2021, 1:26 PM
Bob Bob
- 1
hii
9th Dec 2021, 8:30 PM
Zafir Ali
- 2
place halp me facebook page
9th Dec 2021, 8:30 PM
Zafir Ali