You cheated yourself out of knowledge acquisition by treating a course of education as only a means to get a certificate.
That's cheating.
You're supposed to study the whole course, the examination is a statistical test to see if it's likely that you studied, and can apply, the whole course. If you didn't study the course, you're misrepresenting yourself by during the exam.
That's cheating (in a different way to the first one).
Examinations are imperfect, they usually can't cover an entire course without being too onerous.
In this circumstance you cheated, but did not break the rules for taking the exam. You will be less competent on the course material than is intended for those who pass.