I've seen network administrator at work recently. He was configuring Windows machine in .240 subnet, with address somewhere in the middle of range, and I could virtually see his brains figuring out gateway address. I do not know why there were no DHCP, but anyway, this was a good reason to write a calculator.
Well, let me omit the description of TCP/IP routing and subnetting and go straight to calculator. To use it, enter any IP address from desired subnet, enter subnet mask, and calculator will output subnet address, first available address, which is usually gateway, last available address, broadcast address and number of addresses, which can be assigned to hosts in this subnet.
Subnet mask can be entered "windows" style, like 255.255.255.240, and "router" style - with simple number of bits in the mask, like 24.