How to route ping packet from A to C?

In order to achieve what you would like to have you need to do:

On A, you need to configure the route to 192.168.2.X, that is via 192.168.1.1:

ip route add 192.168.2.0/24 via 192.168.1.1

Note: you can specify a device name with dev DEVICE_NAME or you can omit it in this case.

On B, you need to make sure that packets can be forwarded e.g. ip_forwaring is enabled:

sysctl -w net.ipv4.ip_forward=1

or

echo 1 > /proc/sys/net/ipv4/ip_forward

In addition, you need to allow the traffic between the two networks in the firewall. So something like the following command should to the job:

iptables -I FORWARD -s 192.168.1.0/24 -d 192.168.2.0/24 -j ACCEPT
iptables -I FORWARD -s 192.168.2.0/24 -d 192.168.1.0/24 -j ACCEPT

B has two interfaces (192.168.1.1 and 192.168.2.1) and it already knows where to find both subnets. So in this case you don't need to add additional routes on it.

On C, same as on A, you need to tell 192.168.2.2 how to reach 192.168.1.X, that is via 192.168.2.1:

ip route add 192.168.1.0/24 via 192.168.2.1

And finally, you have to make all these changes permanent, because if you now reboot these nodes, the configuration which you have applied will be gone. How to achieve this depends on the Linux distribution you are using and is not in the scope of your current question :)