Computer for SEE and NEB

It is a complete SEE and NEB solution for computer science. It includes Computer Fundamentals, Database (SQL), Programming in C QBASIC, CSS, JavaScript, and PHP for beginners.

Breaking

Post Top Ad

Your Ad Spot

Tuesday, February 15, 2022

Numeric pattern in QBASIC

 Numeric pattern in QBASIC


1)

1

11

111

1111

11111

 

DECLARE SUB series ()

CLS

CALL series

END

 

SUB series

CLS

a=1

FOR x= 1 to 5

PRINT a

a=a*10+1

NEXT

END SUB

 

2)

11111

1111

111

11

1

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

a = 11111

FOR x = 1 TO 5

PRINT a

a = a \ 10

NEXT

END SUB

 

3)

1

12

123

1234

12345

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS

FOR i = 1 TO 5

FOR j = 1 TO i

PRINT j;

NEXT j

PRINT

NEXT i

END SUB

 

4)

12345

1234

123

12

1

 

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS

FOR x = 5 TO 1 STEP -1

FOR y = 1 TO x

PRINT y;

NEXT y

PRINT

NEXT x

END SUB

 

5)

54321

5432

543

54

5

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS
FOR p = 1 TO 5
FOR q = 5 TO p STEP -1
PRINT q;
NEXT
PRINT
NEXT p
END SUB

 

 

6)

54321

4321

321

21

1

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS
FOR p = 5 TO 1 STEP -1
FOR q = i TO 1 STEP -1
PRINT q;
NEXT q
PRINT
NEXT p
END SUB

 

 

7)

5

45

345

2345

12345

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS
FOR p = 5 TO 1 STEP -1
FOR q= p TO 5
PRINT q;
NEXT q
PRINT
NEXT p
END SUB

 

 

 

8)

1

22

333

4444

55555

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS

FOR p = 1 TO 5

FOR q = 1 TO p

PRINT q;

NEXT q

PRINT

NEXT p

END SUB

 

 

9)

55555

4444

333

22

1

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS

FOR p = 5 TO 1 STEP -1

FOR q = 1 TO p

PRINT p;

NEXT q

PRINT

NEXT p

END SUB

 

 

10)

11111

2222

333

44

5

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS
FOR p = 1 TO 5
FOR q = I TO 5
PRINT p;
NEXT q
PRINT
NEXT p
END SUB

 

11)

1

21

321

4321

54321

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS
FOR I = 1 TO 5
FOR J = I TO 1 STEP -1
PRINT J;
NEXT J
PRINT
NEXT I
END SUB

 

12)

5

54

543

5432

54321

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS
FOR I = 5 TO 1 STEP -1
FOR J = 5 TO I STEP -1
PRINT J;
NEXT J
PRINT
NEXT I
END SUB

 

13)

 1

 33

555

7777

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS

FOR I = 1 TO 7 STEP 2

FOR J = 1 TO I STEP 2

PRINT I;

NEXT J

PRINT

NEXT I

END SUB

 

 

14)

10     20     30     40     50

20     30     40     50     60

30     40     50     60     70

40     50     60     70     80

50     60     70     80     90

 

DECLARE SUB ser ()

CLS

CALL ser

END

 

SUB ser

CLS

FOR x= 0 to 4

FOR y=1 to 5

PRINT (x+y)*10;

NEXT y

PRINT

NEXT x

END SUB

 

15)

1
121
12321
1234321
123454321

DECLARE SUB series ()

CLS

CALL series

END

 

SUB series

a# = 1

FOR x = 1 TO 5

PRINT a# ^ 2

a# = a# * 10 + 1

NEXT

END SUB

 

16)

123454321

1234321

12321

121

1

 

DECLARE SUB series ()

CLS

CALL series

END

 

SUB series

a# = 11111

FOR x = 1 TO 5

PRINT a# ^ 2

a# = a# \10

NEXT

END SUB

 

17)

123454321

1234321

12321

121

1

 

DECLARE SUB series ()

CLS

CALL series

END

 

SUB series

a# = 11111

t=1

FOR x = 1 TO 5

PRINT TAB(t);a# ^ 2

a# = a# \10

t=t+1

NEXT

END SUB

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages