Thread: How to develop good logic in C language

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    1

    Question How to develop good logic in C language

    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?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    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.

  3. #3
    ex-DECcie
    Join Date
    Dec 2005
    Posts
    125
    Quote Originally Posted by rocky
    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?

    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.

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    15
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Java as a Main Language in College Won't Do Good
    By alphaoide in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 01-01-2006, 10:02 AM
  2. Languages dying
    By Zewu in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 07-29-2003, 10:08 AM
  3. Language Script..
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 03-30-2003, 06:48 AM
  4. Good site to learn about Prog. language concept?
    By Extrovert in forum Tech Board
    Replies: 5
    Last Post: 03-13-2003, 02:46 AM