Примеры программ на языке QBASIC

DEFINT A-Z
DIM D(150), N$(7), M(12), T$(12)
WIDTH 80, 43   ' 43 строки, только в QBASIC-e
DATA "Пн","Вт","Ср","Чт","Пт","Сб","Вс"
FOR K = 1 TO 7: READ N$(K): NEXT K
DATA "Январь","Февраль","Март","Апрель","Май","Июнь"
DATA "Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"
FOR K = 1 TO 12: READ T$(K): NEXT K
DATA 31,28,31,30,31,30,31,31,30,31,30,31
FOR K = 1 TO 12: READ M(K): NEXT K
ASK:
     INPUT "На какой год [ 1901 - 2099 ] "; G
     IF G <= 1900 OR G >= 2100 THEN GOTO ASK
COLOR 14, 1: CLS
PRINT : PRINT TAB(16); "К а л е н д а р ь   н а   "; G; "   г о д"
G = G - 1900: K = (((G - 1) \ 4 + G) MOD 7) + 1
IF (G MOD 4) = 0 THEN M(2) = 29
FOR L1 = 1 TO 3: L = L1 * 4: PRINT : PRINT
PRINT TAB(12); T$(L - 3); TAB(27); T$(L - 2);
PRINT TAB(44); T$(L - 1); TAB(59); T$(L): PRINT
FOR I = 1 TO 150: D(I) = 0: NEXT I
FOR I = L1 * 4 - 3 TO L1 * 4
FOR J = 1 TO M(I): D(K) = J: K = K + 1: NEXT J
IF I < L1 * 4 THEN K = K + 7
NEXT I
FOR I = 1 TO 7
IF I = 7 OR I = 6 THEN COLOR 12, 1
IF I < 6 THEN COLOR 14, 1
PRINT "  "; N$(I); "  ";
FOR J = I TO K - 1 STEP 7
IF D(J) > 0 THEN PRINT USING " ##"; D(J);
IF D(J) = 0 THEN PRINT "   ";
NEXT J: PRINT : NEXT I: COLOR 14, 1
K = (K - 1) MOD 7 + 1
NEXT L1