Qbasicnews.com
April 21, 2018, 02:36:27 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Back to Qbasicnews.com
|
QB Online Help
|
FAQ
|
Chat
|
All Basic Code
|
QB Knowledge Base
Home
Help
Search
Login
Register
Qbasicnews.com
>
QBasic
>
QB Projects
>
Ten lines (Collection)
Pages: [
1
]
« previous
next »
Print
Author
Topic: Ten lines (Collection) (Read 6084 times)
lrcvs
Member
Posts: 56
Ten lines (Collection)
«
on:
January 16, 2010, 06:24:58 PM »
'Program multiplication simple
'lrcvs
'(MU) Spain
'13 Jan 2010
'This program is based on: a * b = c >>> a = c / X
CLS
a$ = "9876543298789"
b$ = "2468013"
'a * b
la = LEN(a$) + LEN(b$)
c$ = STRING$(la, "0")
FOR r = 1 TO la
FOR s = 0 TO 9
MID$(c$, r) = LTRIM$(STR$(s))
v$ = LTRIM$(STR$(VAL(c$) / VAL(b$)))
IF v$ = a$ THEN PRINT "Program = "; VAL(c$): PRINT : PRINT "Computer = "; VAL(a$) * VAL(b$): END
IF VAL(a$) < VAL(v$) THEN MID$(c$, r) = LTRIM$(STR$(s - 1)): EXIT FOR
NEXT s
NEXT r
SLEEP
END
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
'Program arithmetic division with integers numbers
'lrcvs
'(MU) Spain
'09 Jan 2010
CLS
a$ = "9876598743014313"
b$ = "388798006"
'A/B
la = LEN(a$)
c$ = STRING$(la, "0")
FOR r = 1 TO la
FOR s = 0 TO 9
MID$(c$, r) = LTRIM$(STR$(s))
v$ = LTRIM$(STR$(VAL(c$) * VAL(b$)))
IF VAL(v$) = VAL(a$) THEN PRINT v$: EXIT FOR
IF VAL(a$) < VAL(v$) THEN MID$(c$, r) = LTRIM$(STR$(s - 1)): EXIT FOR
NEXT s
NEXT r
r$ = LTRIM$(STR$(VAL(a$) - (VAL(c$) * VAL(b$))))
d$ = LTRIM$(STR$(VAL(r$) / VAL(b$)))
PRINT "Program = "; LTRIM$(STR$(VAL(c$))) + " . " + RIGHT$(d$, LEN(d$) - 1)
PRINT
PRINT "Remanence = "; r$
PRINT
PRINT "Computer = "; VAL(a$) / VAL(b$)
SLEEP
END
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
'Program square root
'lrcvs
'(MU) Spain
'12 Jan 2010
CLS
'a$ = number to square root
a$ = "25521342100008787"
la = INT(LEN(a$) / 2) + 1
c$ = STRING$(la, "0")
FOR r = 1 TO la
FOR s = 0 TO 9
MID$(c$, r) = LTRIM$(STR$(s))
v$ = LTRIM$(STR$(VAL(c$) * VAL(c$)))
IF VAL(a$) < VAL(v$) THEN MID$(c$, r) = LTRIM$(STR$(s - 1)): EXIT FOR
NEXT s
NEXT r
t$ = LTRIM$(STR$(VAL(a$) - (VAL(c$) * VAL(c$))))
d$ = LTRIM$(STR$(VAL(t$) / (VAL(c$)) / 2))
PRINT "Square root of = "; a$
PRINT
PRINT "Program = "; LTRIM$(STR$(VAL(c$))) + " . " + RIGHT$(d$, LEN(d$) - 1)
PRINT
PRINT "Remanence = "; t$
PRINT
PRINT "Computer = "; SQR(VAL(a$))
SLEEP
END
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Logged
arockstar
New Member
Posts: 1
Re: Ten lines (Collection)
«
Reply #1 on:
May 12, 2011, 04:43:35 PM »
Ya Its A One Of The Best And Simple Method For It I Am Also Want To Follow It But Its Did Creted By You Is The Same Thin Which I Want To Create So Good And Nice
Logged
lrcvs
Member
Posts: 56
Re: Ten lines (Collection)
«
Reply #2 on:
May 12, 2011, 07:10:46 PM »
Thank you for your good opinion.!
This program is free, use it well.
It was fun doing this program, I hope you like.
Greetings!!!
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
QbasicNews.Com
-----------------------------
=> QB/FB News
=> Site/Forum Issues
=> Challenges
-----------------------------
QBasic
-----------------------------
=> QB Discussion & Programming Help
=> QB Projects
-----------------------------
Qbasic "like" compilers/interpreters
-----------------------------
=> General QB "like"
=> QB64
=> FB Discussion & Programming Help
===> FB Projects
===> FB Documentation
-----------------------------
General
-----------------------------
=> General/Misc
===> Art & Music
===> General Programming
Loading...