i am a beginner in C programming. i find programming very tough and also my logic is not good. can anyone tell me how to develop logic in C programming?
i am a beginner in C programming. i find programming very tough and also my logic is not good. can anyone tell me how to develop logic in C programming?
By doing lots and lots of programming. At least that is how I develped my logic.
STL Util a small headers-only library with various utility functions. Mainly for fun but feedback is welcome.
Originally Posted by rocky
Personally, I think that logic is a separate thing from programming.
To me, logic is HOW you solve the problem, regardless of what language you're eventually going to use. Yes, if you tend to program in one language more than others you might think in that idiom, but try to keep things very generic.
For example, if you're tasked with modeling a banking transaction, you can break the transaction down into component steps. For a deposit, it would be receive the amount of money from the customer, find their account, update that account with the additional funds and then give the customer a receipt.
None of that really has anything to do with C, Python, Perl, C++, Java, Lisp or any other language. Once you decide what the steps are that you have to follow (i.e. your "logic") then you can determine how best to implement those steps in your chosen language.
Sometimes you can get really hung up trying to approach a problem once you've decided on the language. And yes, there are always restrictions -- your shop many only use one specific language, or for security you want something that is compiled as opposed to something that is scripted...
But do try to approach the problem as generically as possible.
Maybe the follow steps can hlp u ^.^
1) Find out the requirements/limitation for the program u r goin to do
2) Visual how the output is going to be
3) Program it.