Since switch works on the second layer of the OSI model, it won't know which computers are in the same network or not.
To be accurate, based on your description, all three of your hosts are on the same network from a L2 perspective and the switch knows this to be the case. The switch doesn't care about what IP addresses are as it is only using the L2 addressing.
L2 broadcasts and unicast floods will be received by all three computers in your example. For example, if A ARPs for B, C will also see this broadcast.
What forbiddens computer C to answer an ARP request coming from the computer A?
Nothing on the switch prevents C from answering a request from A.
However, in this example, A will never send a request to C. If A has traffic for C, A will use it's own IP address and mask to determine if C is on the local network or not. In this case it is not, so A will then look to it's routing table to determine where to forward this traffic (on most computers this will typically be the default route or gateway).
Let's extend this example a bit and say that B is misconfigured with a /22 mask (smallest network to include both 192.168.1.0/24 and 192.168.2.0/24) instead of the /24 it should have. If B had traffic for C, it would determine that C is on the local network and B would ARP for C. When C receives this ARP request, it should not respond as it would determine that B is not on the local network.