Step 1: Types of companies by incorporation.
- Companies may be incorporated under the Companies Act, 2013 (general companies).
- Some companies are created by a Special Act of Parliament (e.g., LIC, SBI).
Step 2: Eliminate wrong option.
Agreement of investors alone does not create a legal company. Registration under law is essential.
Step 3: Conclude.
Therefore, a company can be incorporated by both (A) Special Act of Parliament and (B) Companies Act.
Final Answer:
\[
\boxed{\text{(A) and (B) both}}
\]