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
Maha
NA
0
329.4k
Ternary Operator
Apr 26 2014 9:48 AM
What one can learn from ternary operator? Because in1>n2 and n1<n2 are giving different output. An example program is given. Problem is highlighted.
using System;
class Program
{
static void Main(string[] args)
{
int n1, n2;
n1 = 10;
n2 = 20;
int max = (n1
>
n2) ? n1 : n2;
Console.WriteLine(max);
//20
int min = (n1
<
n2) ? n1 : n2;
Console.WriteLine(min);
//10
Console.ReadKey();
}
}
Reply
Answers (
3
)
Crystal Reports Viewer save to SQL table
Passing Data Between Forms