Hi, I got an Arduino UNO r3 from a friend ,but unfortunately he didn't have the cable .
So I was wondering can i use any USB B cable?
Welcome to the forum
You can use any USB cable that fits the socket on the Uno. Some Arduino boards use a micro USB connector and that sometimes causes problems because people try to use a USB cable that only has power wires and no data wires. That is not the case with the USB B connector on the Uno