'why errors arise at the first return and (:) operator? [closed]

public int factorial(int number)
        {
            number <= 0 ? return 1 : return number * factorial(number - 1);
        }

The compiler tells me to that the first return is an invalid expression and there is a ; and } expected what should I do?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source