What do you mean by "safe"? I don't think goto makes it any less safe given that you didn't make a mistake. It's not to recommend using though. system("cls"); might be considered unsafe. What if cls is a virus? Both programs have problems with termination. The first one never terminate. The second one fails to terminate if EOF is reached.