Use 'if-else' instead of 'while' inside for better understanding.