TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
moni moni
NA
2
420
confusion about code
Apr 7 2019 12:20 PM
Hi
I am new to C#, I just finished watching a part of a tutorial. I am confused about a line of code, which I did not understand. here is the code,
int
userValue = 2;
string
message = (userValue == 1) ?
"boat"
:
"car"
;
Console.WriteLine(
"{1} - {0}"
, userValue, message);
Console.ReadLine();
output: car - 2
my question is for line 3. why its print "car" first? shouldn't it be "2" first?
because it says here
Console.WriteLine("{1} - {0}", userValue, message);
doesn't it mean {1} assign to 'userValue' & {0} assign to 'message'?
I am really confused here.
I am sorry if I post this question in wrong section.
thanks
Shumon
Reply
Answers (
1
)
AES 128 -bit Encryption-Decryption in C#
How to control borders of specific cells in ms-word table?