Qbasicnews.com
May 27, 2018, 04:51:04 PM *
Welcome, Guest. Please login or register.

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  
Pages: [1]
  Print  
Author Topic: Multiplication Table  (Read 7279 times)
lrcvs
Member
*
Posts: 56


« on: August 07, 2009, 06:17:09 PM »

CLS
FOR x = 0 TO 10
FOR y = 0 TO x
p$ = p$ + STR$(x * y) + " "
NEXT y
IF x < 10 THEN PRINT USING "##"; y - 1; : PRINT " "; p$; : PRINT USING "##"; y
IF x = 10 THEN PRINT USING "##"; y - 1; : PRINT " "; p$
p$ = ""
NEXT x
END

Multiplication table.

Read to rigth, after, to down, until end

0  0
1  0 1
2  0 2 4
3  0 3 6 9
4  0 4 8 12 16
5  0 5 10 15 20 25
6  0 6 12 18 24 30 36
7  0 7 14 21 28 35 42 49
8  0 8 16 24 32 40 48 56 64
9  0 9 18 27 36 45 54 63 72 81
10  0 10 20 30 40 50 60 70 80 90 100




Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!