• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How to write an algorithm?

Do anyone here know how to write an algorithm? Please show me some basic? I'm quite new to it as I'm learning computing.

How to write an algorithm that finds the smaller of two numbers a and b? Can anyone enlighten me?

Thanks

Regards
 
An algorithm does not necessarily have to have anything to do with computing or programming. It is merely a list of steps for how to do something. A cooking recipe would count as an algorithm, and would pretty much any step-by-step list of instructions. For your question, the only step would be to compare the numbers, and maybe swap them depending on if you want them ordered smallest to largest or largest to smallest
 
Originally posted by: zimmie6576
An algorithm does not necessarily have to have anything to do with computing or programming. It is merely a list of steps for how to do something. A cooking recipe would count as an algorithm, and would pretty much any step-by-step list of instructions. For your question, the only step would be to compare the numbers, and maybe swap them depending on if you want them ordered smallest to largest or largest to smallest


Yup this is what I want.

e.g:

Input: .....
Output:......
BEGIN
1. ......
2. .......
3. ......
4. WRITE ....
END

Could you help me by solving that question as I need to see how's algorithm is written pls?
 
I didn't even know there was a format for writing algorithms in general. It seems easiest to express it in a programming language. I just assumed that you were talking about programming because you mentioned computing.
 
I'm going to learn C programming this year and I'm very new to this course. Can anyone give me some advices or some tips on how to do well in c programming?

Any free sites on detail learning of C programming?

Regards
 
If it's an intro to programming class, they should teach you from the beginning. The only way that I can think of to prepare for a programming class is to learn to program in advance... which defeats the point of taking an introductory course.

If you run into problems, you can just post here and people will be able to help you. You can also just search Google for a tutorial that you like, although I've always preferred programming books over online tutorials.
 
Back
Top