ehm by making a function for it ? and put it in your loop lookup google how c++ functions work its quite simple in fact