So if you're located in the United States, more than likely the hot and cold water lines going to the washing machine are 3/4". In which case, you can use a brass Garden house cap in 3/4". You can find the 3/4" end caps at any plumbing store. Home Depot sells Everbuilt Garden Hose caps for around $2 each. You may also want to check out amazon's selection of 3/4" Garden Hose caps. Make sure the cap has a rubber washer inside.
Also it's recommend to use joint compound or sealant tape on the male threads before capping the water line, to ensure water line cap is completely leak free.