Call If-Else Condition in a Single Line



Syntax...

(COndition) ? "Value For true":" Value For False "

Example

if(x==1)
{
x=10;
}
else
{
x=15;
}

====> It Will wriiten in a single Line

x=(x==1)?10:15;

Done
Ebook Download
View all
Learn
View all