This conditional statement behaves exactly like an if…else statement. The main
reason to use the ternary operator is convenience in coding. Its syntax is as
follows:condition ? statement1 : statement2;
The condition is checked first and if true, statement1 is executed, if false,
statement2 is executed. However, the two expressions following the question
mark (?) must be of the same data type.
This example using the ternary operator, is equivalent in logic and results to the
previous example using the if...else statement.int i = 12;
int j = 10;
int max;
max = i > j ? i : j;
Best Regards,
Hossein Karimi
Friday, June 29, 2018
Ternary Operator
Labels:
X++
+10 years of experience with hands-on lead-level background in the full life cycle of software development with demonstrated cross-functional team leadership skills.
Programming:
• ERP :Microsoft Dynamics AX 2012
• Language :X++, C#, C++, XAML, Asp.Net, Html, VB.Net, Android
• Environment : Windows XP, Windows 8, Windows 10, Windows Server
• DataBase : Oracle 9i,10g,11g and SqlServer and SQLlite
Subscribe to:
Post Comments (Atom)
Configure the Firewall on the Enterprise Portal Server
After you install Enterprise Portal, enable Web Server (HTTP) in Windows Firewall. If you do not enable the web server in Windows Firewall...
-
In Reporting Services, reports and resources are processed under the security identity of the user who is running the report. If the report ...
-
The below select query will give the both the Sales Line record count and the sum of sales quantity. static void Test_Data(Args _args) ...
-
To integrate Microsoft Dynamics AX and Analysis Services, you must connect Analysis Services to the Application Object Server (AOS). To do s...
No comments:
Post a Comment