while and for loop exercise