C#
Code
# Code
```csharp []
public class ProductOfNumbers {
    private List<int> products;

    public ProductOfNumbers() {
         products = new List<int> { 1 };
    }
    
    public void Add(int num) {
         if (num == 0)
 {
     // Reset the product list if the number is zero
     products = new List<int> { 1 }; // Reset with a base product of 1
 }
 else
 {
     // Append the new product to the list
     products.Add(products[products.Count - 1] * num);
 }
    }
    
    public int GetProduct(int k) {
         if (k >= products.Count)
 {
     return 0;
 }
 // Return the product of the last k numbers
 return products[products.Count - 1] / products[products.Count - 1 - k];
    }
}

/**
 * Your ProductOfNumbers object will be instantiated and called as such:
 * ProductOfNumbers obj = new ProductOfNumbers();
 * obj.Add(num);
 * int param_2 = obj.GetProduct(k);
 */
```
['C#']