You are here:

C/algorithms in C Language

Advertisement


Question
Hello sir,

My question is "how to write algorithms"?

That is, whether i need to use any specific terminology for all conditional and looping structures, creation of variables, decrement/increment of variables, etc.  I can write simple programs in C, but i cannot design algorithms for which i can write programs.  Can i express my ideas using general english words or should i need to confine to a specific terminology.  For this reason, i failed twice in my exam (IGNOU MCA) and i am facing problems while preparing for the exam.

Please help me with your valuable suggestions and suggest a very basic book on algorithms.

Thanks a lot for your help.

Siva ram

Answer
There are so many books on the subject in the market.
I had referred "Horowitz and Sawhni" during my engineering.

Usually students try to study algorithms along with a programming language. Many books also come like that.
But my opinion is that, we must study algorithms independently. No language should be clubbed with that.
After understanding the basic algorithms, then you can use ANY language to implement this.

So, first study and understand the algorithms.
Write algorithms on your own and try to simulate (manually) it. This will help you in writing and correcting your algorithms.

Algorithms are nothing but STEPS that you have to follow to get the result.
For example, you have to write an algorithm for adding two numbers and displaying the results.
So, what steps are needed for this.
Write the steps in basic/plain english.
This makes the begining of your algorithm.
After that, refined it by introducing some variables to store the values and results and give each step a serial number.

Hope this gives you an idea.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.