Write a Python function to update a dictionary with another dictionary and return the updated dictionary.
Example 1:
Input: {"a": 1, "b": 2}, {"b": 3, "c": 4}
Output: {"a": 1, "b": 3, "c": 4}
Example 2:
Input: {"x": 10, "y": 20}, {"y": 30, "z": 40}
Output: {"x": 10, "y": 30, "z": 40}