+ 1
The output comes x=204.55 and y=10090 but my x is an integer?? int x = 10090; double y = 204.55; Console.WriteLine("x = {1}; y = {0}", x, y);
7 Respuestas
+ 6
you just inverted them
Console.WriteLine("x={0};y={1}",x,y);
+ 5
That's because the "x={1}" doesn't use the int x, but uses the string inside the quotes. the {1} functions as a placeholder for the y variable.
+ 3
Improper placement of Conversion Specifier.
{0} Maps to First Argument & {1} to Second and So on.
+ 1
This is because you have not written the bases in correct order. int x has base order 0 and double y has base order 1. Just revert them and you will get your answer.
+ 1
swap the numbers
0 for x and 1 for y...
0
in Console.WriteLine("Hello {0}", yourName) why after hello "{0} " is there please explain it ??
- 1
Simple words 0 comes before 1.. You made "x" = equal to 1 which made it the same as y
You did the same for "y" you made it = equal to 0 which made it the same as the original number for "x"