Oh, I know this situation very well. At the beginning of the semester all tests seem so far in the future, all lectures so basic and boring, there is the inescapable call of doing any one of the wonderful things there are to do in life. Surely it won't matter to skip a lecture or a homework, maybe two?

Annnnd, bam, there comes the test tomorrow. And the realization that there is a significant gap between your skills and the level of the test. The good news is, there is still hope. I was in your shoes once, but I too finished my degree, so you'll have the opportunity to profit from my experiences. (Sorry if it sounds condescending, but it was you who asked a question, it is me who is writing an answer and nobody is forcing you to read or obey it.)

I commend you for your honesty and your perseverance. You have admitted that you know nothing, but still wish to look for solutions even if that means cramming a whole semester worth of knowledge in your head during the span of a single day. Most people are incapable of either of these, yet you have managed both, this means you have the guts to do this.

The time left is not nearly enough to make a recognizable improvement on your current C skills, so it does not matter what books, lectures, exercises or tests you pick for studying this day. Heck, at this point it does not matter at all whether you study or not.

Luckily for you, a great part of programming is just plain, simple logic and algorithmization, which is language-independent. Therefore you have a non-negligible chance of passing the test even with your current skill level. Therefore, your best choice would be to spend that one day reflecting on your choices.

The next day you should not attend the test. This might sound crazy, but hear me out. You will fail the class, this is correct, and of course a pretty big minus. There is, however, a much more important positive which overwhelms the whole "failing a class" problem. This is the chance to repeat the class, this time correctly.

If you took this course, that probably means you are looking to have a career in programming, or just are plainly interested in programming. What you had was not an obligation to study, but a chance for it. Sadly, you have somehow lost (wasted?) this opportunity, but you might have another one to make up for it.

So next time you take this class, attend the lectures, do the exercises (even those that are optional), find someone to study with or somebody to tutor you and you'll pass the test with flying colors. But more importantly, you'll gain a skill for your life.

I wish someone had told me this years ago when I was struggling in university.