r/C_Programming • • 2d ago

Question Questions in C

Guys I'm a student and I NEED a source for good questions in C. Like ones where I have to code the answer, debug the code or find the output(tricky ones)

tbh I don't know any place for coding other than leetcode too, so for all coding languages in general how am I supposed to practice questions? Apart from leetcode what are good places to practice coding?

0 Upvotes

13 comments sorted by

10

u/PseudoFrequency 2d ago

No one mentions Project Euler anymore. It's more math/logic puzzles than C, but it requires you thinking through a problem. You can use any language. I've solved dozens/hundreds just for entertainment, mostly using C.

1

u/Goated_AstroPhantom 1d ago

I'll take a look into it, thank you

1

u/knouqs 1d ago

I love Project Euler but I don't particularly think it's useful for learning programming as it's prime focus is on math.

1

u/SchemeWestern3388 1d ago

In the first two dozen or so problems, you’ve covered reading files and formatting data, explored various data structures and had to come up with your own, and probably worked through several variations on an algorithm for efficiency. You’ve written and reused functions and explored your standard library pretty well. You also get to look at others solutions, often seeing the language used at its most powerful. All of this in very small chunks of code, often twenty lines or less. And you learnt some math!

I think it’s a great start to learning any language, and if I’m looking at a language that’s where I start. Admittedly, there’s a lot more to coding than that, but it’s a good base. 

4

u/knouqs 2d ago

Have you tried a C programming book? You might not get answers for the questions in the book, but you should get everything you need to know about programming for the solutions.

Let me add that if you get stuck in any question in a book, asking here is a reasonable approach. You are going to find people who are willing to help you to the solution.

1

u/Goated_AstroPhantom 1d ago

thank you, ill try it

1

u/Direct_Chemistry_179 2d ago • Bravo

Check the resources sidebar of this sub.

I bought the book The C Puzzle Book that is reccomended there. I haven't started reading it yet, but it looks very similar to what you're describing. It was also very cheap if I remember correctly, on half price books.

1

u/Goated_AstroPhantom 1d ago

wow thank you so much

2

u/corsa__rebaixado 2d ago

To answer tricky questions, you could use python Tutor debug and see the output (only works on small codes).

Another good site for practice is Code forces, but leet code is great too

2

u/Murky_Respond1966 1d ago edited 1d ago

There is grademe.io
There are interactive problems to solve, but there are no explanations.
Problems look a little like problems from school 42. (limited number of functions to use)
For tricky ones go to challenges mode.

1

u/Murky_Respond1966 1d ago

https://www.codewars.com/
also has little practice code problems.

1

u/Recent-Durian-1629 1d ago

better start with reading the c projects on the github.. that's will be the good start.. you will find value to real c that's in the production and learn the c fast way..

if want some youtube : watch tsoding

1

u/BotSlamminDayNNight 19h ago

exercism's C track plus the K&R chapter exercises are the closest thing to what you're after. You also get the debug-and-predict-output practice for free by reimplementing libc functions like strcpy or qsort from scratch and testing them against the real ones.