Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
LET A = 123456
PRINT MID$(A,1,2), MID$(A,3,2), MID$(A,5,2),
LET A = 123456
FOR X = 0 TO 2
PRINT MID$(A,X*2+1,2)
NEXT
rem If number is 123456, I want to out put 12 or 34 or 56
N = 123456
A = N \ 10000
T = N \ 100
B = T mod 100
C = N mod 100
print "N = ", N
print "A = ", A
print "B = ", B
print "C = ", C
N = 123456
A = 12
B = 34
C = 56
Rem Using loops
NN = 123456
Print "number =", NN
N = NN
Print "do-while-loop"
Do While N > 0
X = N Mod 100
N = N \ 100
Print X
Loop
N = NN
Print "while-wend loop"
While N > 0
X = N Mod 100
N = N \ 100
Print X
Wend
N = NN
Print "loop with exit"
Do
If N = 0 Then Exit Do
X = N Mod 100
N = N \ 100
Print X
Loop
pya said:but I do not understand Lines 80, 100 and 110. (see attached File)
80 K$ = Input$(1)
100 T = N \ 100
110 B = T Mod 100
100 T = N \ 100
110 B = T Mod 100
100 B = N Mod 100
100 T = N \ 100
110 B = N - 100*T
you can use 3 printspya said:I use a PRINT statement to insert a blank line.
If I want to insert multiple blank lines, say 3, how do I do that?
Print
Print
Print
Rem 3 blank lines with LF
LF$ = Chr$(10)
Print LF$ + LF$
MagicNumber = 13837 * 73
Print "MagicNumber =", MagicNumber
NUMBER = 99
Print "NUMBER =", NUMBER
N = MagicNumber * NUMBER
Print "MmagicNumber * NUMBER =", N
T = N \ 100
Print "T =", T
B = N - 100 * T
Print "B =", B
MagicNumber = 1010101
NUMBER = 99
MmagicNumber * NUMBER = 1E+08
T = 1000000
B = 0
MagicNumber = 3 * 7 * 13 * 37
Print "MagicNumber =", MagicNumber
NUMBER = 99
Print "NUMBER =", NUMBER
N = MagicNumber * NUMBER
Print "MmagicNumber * NUMBER =", N
T = N \ 100
Print "T =", T
B = N - 100 * T
Print "B =", B
MagicNumber = 10101
NUMBER = 99
MmagicNumber * NUMBER = 999999
T = 9999
B = 99
10 Cls
20 Print
30 Print "Enter any Number between 1 and 99"
40 Input "Enter your Secret Number"; NUMBER
50 If NUMBER <> Int(NUMBER) GoTo 30
60 If NUMBER < 1 Or NUMBER > 99 GoTo 30
70 Cls
80 K$ = Input$(1)
90 N = 3 * 7 * 13 * 37 * NUMBER
100 B = N Mod 100
110 Color 14, 0, 0
120 Print "Your Secret Number is = ", B
130 Print
140 Color 7, 0, 0
150 GoTo 30
999 End
MagicNumber = 1010101010101
MagicNumber = 101010101010101
Rem data types - see:
Rem [URL unfurl="true"]https://www.qb64.org/wiki/Data_types#Unsigned_Integer_types[/URL]
Print "*using DOUBLE variables:"
Dim As Double MagicNumberD, NumberD, ND, TD, BD
MagicNumberD = 1010101010101
Print "MagicNumber =", MagicNumberD
NumberD = 99
Print "NUMBER =", NumberD
ND = MagicNumberD * NumberD
Print "MmagicNumber * NUMBER =", ND
TD = ND \ 100
Print "T =", TD
BD = ND - 100 * TD
Print "B =", BD
Print
Rem ******************************************
Print "*using _UNSIGNED _INTEGER64 variables:"
Dim As _Unsigned _Integer64 MagicNumberU, NumberU, NU, TU, BU
MagicNumberU = 10101010101010101
Print "MagicNumber =", MagicNumberU
NumberU = 99
Print "NUMBER =", NumberU
NU = MagicNumberU * NumberU
Print "MmagicNumber * NUMBER =", NU
TU = NU \ 100
Print "T =", TU
BU = NU - 100 * TU
Print "B =", BU
Print
MagicNumberU = 1001001001001001
Print "MagicNumber =", MagicNumberU
NumberU = 999
Print "NUMBER =", NumberU
NU = MagicNumberU * NumberU
Print "MmagicNumber * NUMBER =", NU
TU = NU \ 1000
Print "T =", TU
BU = NU - 1000 * TU
Print "B =", BU
Print