Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze games gaming hard drive hardware hdmi internet laptop malware memory monitor motherboard netgear network printer problem ram random registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
How to write an algorithm?

Reply  
Thread Tools
jnwk888hwq's Avatar
Junior Member with 2 posts.
 
Join Date: Jul 2003
27-Jul-2003, 01:58 PM #1
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

Last edited by jnwk888hwq; 27-Jul-2003 at 02:07 PM..
Corrosive's Avatar
Senior Member with 1,074 posts.
 
Join Date: Jan 2003
Location: Scotland
27-Jul-2003, 03:40 PM #2
An algorithm is just another name for a program. What programming language are you using?

A basic way of doing this in, erm, BASIC, goes something like this:

let a=1
let b=2
let total=a+b
print total
end

The first line puts the number 1 into a variable named "a." Likewise, the second line puts the number 2 into "b." the third adds them together and puts the total (which is 3, obviously) into the cryptically named "total" variable. Line 4 then displays whatever is stored in "total" (3) on screen, and the last ends the program.
__________________
"Computer games don't affect kids - I mean, if Pacman affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."
- Kristian Wilson [Nintendo Executive 1989]

Anyone fancy going out clubbing tonight?
dtech10's Avatar
Member with 55 posts.
 
Join Date: Jan 2003
28-Jul-2003, 11:42 AM #3
How to write an algorithm?
let a=10
let b=15
let lowest=0

if a<b
lowest=a
else
lowest=b
endif
print "lowest=",lowest
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:36 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.