ternary operator in c

C
x = condition ? expression1 : expression2

// Example:
double x = 1 > 0 ? 10 : 20; // put any value(condition) ? (if true, do this) : (otherwise, do this)int a = 10, b = 20, c;

c = (a < b) ? a : b;

printf("%d", c); if ($scope.SearchSalesOrderAndCompanyName !== undefined && $scope.SearchSalesOrderAndCompanyName != null ) {
            SearchCriteria += " AND [SalesOrderNo] LIKE '%" + $scope.SearchSalesOrderAndCompanyName + "%' OR ([SO].[CompanyNameOnBill] LIKE '%" + $scope.SearchSalesOrderAndCompanyName + "%')";
        }
        if ($scope.FromDate !== undefined && $scope.FromDate !=null) {
            SearchCriteria += " AND [SO].[SalesOrderDate] LIKE '%" + $scope.FromDate + "%'";
        }
      (n1 > n2) ? n1 : n2;
             OR
n1 > n2 ? n1 : n2;c = (a < b) ? a : b;
Source

Also in C: