Changing major

Probably a dumb question but if I fail a class and change my major does that F stay on my GPA?