Computer Notes, Programming codes, Hardware and Networking Tip, Entertainment, Biography, Internet Tip, Tech News, Latest Technology, YouTube,

Articles by "Printing Series in qbasic"
About RAM Advantages of multiprocessing system Associative memory Binary Number System CA CA Notes Change drive icon change pendrive icon Computer Abbreviation Computer Architecture Computer fundamental MCQ Computer Generation Computer generation computer notes Computer MCQ Computer Network MCQ Computer Operator MCQ Critical Section Critical section in OS Database connectivity in java Deadlock avoidance Deadlock detection algorithm Deadlock Detection and Recovery Deadlock detection method Deadlock Handling Deadlock in OS Deadlock Prevention Deadlock Recovery define object and class Define system cell Descrete Structure Device Driver Device driver in computer device driver in os DFA DFA contains with DFA ends with dfa examples dijkstra's algorithm Discrete Structure Discrete Structure graph theory Download JDBC Driver Download MySql Download PUBG DS DS Notes FCFS Job Scheduling Algorithm Finding shortest path Finite Sate Automata Flynn's Classifications fragmentation in computer fragmentation in harddisk fragmentation in os fragmented memory Full form related to computer Generations of operations Generations of OS Graph theory ICT 1st semester notes Instruction Address Modes Java java array declaration java class and object example Java Database connectivity example java event handling example program Java JDBC Java JMenuBar Java JSP program example java notes java program methods example Java program to create class and object java program to create methods java program to print even number between any two numbers Java programming java programming notes Java programs Java question answer java swing example java swing program to calculate simple interest Java Tutorials JSP program learn qbasic Lekh MCQ MCQ Computer MCQ Operating System memory fragmentation MICT 1st semester notes mict 1st semester operating system notes MICT first semester notes Multiprocessing mutex in os Necessary conditions for deadlock Number System Operating System Operating system notes OS OS Notes OS Numeric pattern printing program in qbasic patterns in qbasic Pipeline Hazards Pipelining Pipelining concept prime or composite in qbasic print patterns qbasic print series in qbasic Printing Series in qbasic PUBG PUBG Mobile PUBG PC PUBG Story qbasic qbasic code qbasic for class 10 qbasic for class 8 qbasic for class 9 qbasic for school QBASIC Pattern printing qbasic pattern printing program qbasic pattern printing programs qbasic pattern types qbasic patterns qbasic programming tutorials qbasic programs qbasic sequence printing programs qbasic tutorials Race Condition in Operating system reverse order in qbasic RISC and CISC RISC Pipeline Scheduling algorithm segmentation in operating system segmentation in os semaphore and mutex Semaphore concept in os Semaphore in os semaphore in os notes semaphore meaning sequential programs in qbasic series in qbasic series printing programs in qbasic shell in operating system shell in os shortest path shortest path algorithm simple interest program in java swing System Bus System Cell Teach Blog Tech Blog Tech School technical school The Shell in Operating system types of fragmentation Types of Multiprocessor types of operating system Types of pipeline hazards View Connected Wifi password Virtual Memory Virtual memory in OS Von Neumann's architecture What is associative memory? what is class? What is computer system? What is Fragmentation? What is jsp? what is object? What is process? What is segmentation What is System Cell What is Thread? what is virtual memory in computer What is virtual memory? पब्जी गेम


1) 8, 18, 32, 50 ...... up to 10th term.

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
FOR i = 2 TO 10
    PRINT i ^ 2 * 2;
NEXT i
END
CLS
i = 2
WHILE i <= 10
    PRINT i ^ 2 * 2;
    i = i + 1
WEND
END
CLS
i = 2
DO WHILE i <= 10
    PRINT i ^ 2 * 2;
    i = i + 1
LOOP
END

2) 2, 4, 8, 16, 32 upto 10th term. 

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
n = 2
FOR i = 1 TO 10
    PRINT n;
    n = n * 2
NEXT i
END
CLS
n = 2
i = 1
WHILE i <= 10
    PRINT n;
    n = n * 2
    i = i + 1
WEND
END
CLS
n = 2
i = 1
DO WHILE i <= 10
    PRINT n;
    n = n * 2
    i = i + 1
LOOP
END

3) 2, 4, 6, 10, 16 ..... up to 10th term.(Fibonacci Series)

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
x = 2
y = 4
PRINT x; y;
FOR i = 1 TO 10
    z = x + y
    PRINT z;
    x = y
    y = z
NEXT i
END
CLS
x = 2
y = 4
i = 1
PRINT x; y;
WHILE i <= 10
    z = x + y
    PRINT z;
    x = y
    y = z
    i = i + 1
WEND
END
CLS
x = 2
y = 4
i = 1
PRINT x; y;
DO WHILE i <= 10
    z = x + y
    PRINT z;
    x = y
    y = z
    i = i + 1
LOOP
END

4) 4, 4, 8, 12, 20 ..... up to 10th term. (Fibonacci Series)

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
x = 4
y = 4
PRINT x; y;
FOR i = 1 TO 10
    z = x + y
    PRINT z;
    x = y
    y = z
NEXT i
END
CLS
x = 4
y = 4
i = 1
PRINT x; y;
WHILE i <= 10
    z = x + y
    PRINT z;
    x = y
    y = z
    i = i + 1
WEND
END
CLS
x = 4
y = 4
i = 1
PRINT x; y;
DO WHILE i <= 10
    z = x + y
    PRINT z;
    x = y
    y = z
    i = i + 1
LOOP
END

5) 8, 18, 32, 50 ..... up to 10th term. 

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
FOR i = 2 TO 10
    PRINT i ^ 2 * 2;
NEXT i
END
CLS
i = 2
WHILE i <= 10
    PRINT i ^ 2 * 2;
    i = i + 1
WEND
END
CLS
i = 2
DO WHILE i <= 10
    PRINT i ^ 2 * 2;
    i = i + 1
LOOP
END


 QBASIC Programs to print series using different Looping Statements

1) 5, 25, 125, 625, 3125 .... up to 7th terms.

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
a = 5
FOR i = 1 TO 7
    PRINT a;
    a = a * 5
NEXT i
END
CLS
a = 5
i = 1
WHILE i <= 7
    PRINT a;
    a = a * 5
    i = i + 1
WEND
END
CLS
a = 5
i = 1
DO WHILE i <= 7
    PRINT a;
    a = a * 5
    i = i + 1
LOOP
END

2) 1, 4, 9, 16, 25 .... up to 10th term.

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
FOR i = 1 TO 10
    PRINT i ^ 2;
NEXT i
END
CLS
i = 1
WHILE i <= 10
    PRINT i ^ 2;
    i = i + 1
WEND
END
CLS
i = 1
DO WHILE i <= 10
    PRINT i ^ 2;
    i = i + 1
LOOP
END

3) 1, 8, 27, 64, 125 ... up to 10th term.

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
FOR i = 1 TO 10
    PRINT i ^ 3;
NEXT i
END
CLS
i = 1
WHILE i <= 10
    PRINT i ^ 3;
    i = i + 1
WEND
END
CLS
i = 1
DO WHILE i <= 10
    PRINT i ^ 3;
    i = i + 1
LOOP
END

4) 1, 27, 125, 343, 729

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
n = 1
FOR i = 1 TO 5
    PRINT n ^ 3;
    n = n + 2
NEXT i
END
CLS
n = 1
i = 1
WHILE i <= 5
    PRINT n ^ 3;
    n = n + 2
    i = i + 1
WEND
END
CLS
n = 1
i = 1
DO
    PRINT n ^ 3;
    n = n + 2
    i = i + 1
LOOP WHILE i <= 5
END

5) 1000, 500, 250, 125, 62.5

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
n = 1000
FOR i = 1 TO 5
    PRINT n;
    n = n / 2
NEXT i
END
CLS
n = 1000
i = 1
WHILE i <= 5
    PRINT n;
    n = n / 2
    i = i + 1
WEND
END
CLS
n = 1000
i = 1
DO
    PRINT n;
    n = n / 2
    i = i + 1
LOOP WHILE i <= 5
END

6) 10, 8, 6, 4, 2

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
FOR i = 10 TO 1 STEP -2
    PRINT i;
NEXT i
END
CLS
i = 10
WHILE i >= 1
    PRINT i;
    i = i - 2
WEND
END
CLS
i = 10
DO WHILE i >= 1
    PRINT i;
    i = i - 2
LOOP
END

7) 1, 3, 5, 7, 9 ...... 25

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
FOR i = 1 TO 25 STEP 2
    PRINT i;
NEXT i
END
CLS
i = 1
WHILE i <= 25
    PRINT i;
    i = i + 2
WEND
END
CLS
i = 1
DO
    PRINT i;
    i = i + 2
LOOP UNTIL i >= 25
END

8) 0, 2, 4, 6, 8 ...... up to 100

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
FOR i = 0 TO 100 STEP 2
    PRINT i;
NEXT i
END
CLS
i = 0
WHILE i <= 100
    PRINT i;
    i = i + 2
WEND
END
CLS
i = 0
DO WHILE i <= 100
    PRINT i;
    i = i + 2
LOOP
END

9) 5, 125, ... up to 7th term.

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
n = 5
FOR i = 1 TO 7
    PRINT n;
    n = n ^ 3
NEXT i
END
CLS
n = 5
i = 1
WHILE i <= 7
    PRINT n;
    n = n ^ 3
    i = i + 1
WEND
END
CLS
n = 5
i = 1
DO WHILE i <= 7
    PRINT n;
    n = n ^ 3
    i = i + 1
LOOP
END

10) 0.1, 0.11, 0.111 .... up to 7th term.

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
a = 0.1
FOR i = 1 TO 7
    PRINT a;
    a = a / 10 + 0.1
NEXT i
END
CLS
a = 0.1
i = 1
WHILE i <= 7
    PRINT a;
    a = a / 10 + 0.1
    i = i + 1
WEND
END
CLS
a = 0.1
i = 1
DO
    PRINT a;
    a = a / 10 + 0.1
    i = i + 1
LOOP WHILE i <= 7
END

11) 5, 55, 555 .... up to 7th terms.

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
n = 5
FOR i = 1 TO 7
    PRINT n;
    n = n * 10 + 5
NEXT i
END
CLS
n = 5
i = 1
WHILE i <= 7
    PRINT n;
    n = n * 10 + 5
    i = i + 1
WEND
END
CLS
n = 5
i = 1
DO WHILE i <= 7
    PRINT n;
    n = n * 10 + 5
    i = i + 1
LOOP
END

12) 3333333, 333333, 33333, 3333 .... 3

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
n = 3333333
FOR i = 1 TO 7
    PRINT n;
    n = n \ 10
NEXT i
END
CLS
n = 3333333
i = 1
WHILE i <= 7
    PRINT n;
    n = n \ 10
    i = i + 1
WEND
END
CLS
n = 3333333
i = 1
DO WHILE i <= 7
    PRINT n;
    n = n \ 10
    i = i + 1
LOOP
END

13) 0.11111, 0.1111, 0.111 .... 0.1

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
n = 0.11111
FOR i = 1 TO 5
    PRINT n;
    n = n * 10 - 1
NEXT i
END
CLS
n = 0.11111
i = 1
WHILE i <= 5
    PRINT n;
    n = n * 10 - 1
    i = i + 1
WEND
END
CLS
n = 0.11111
i = 1
DO WHILE i <= 5
    PRINT n;
    n = n * 10 - 1
    i = i + 1
LOOP
END

14) 1, 1, 2, 3, 5, 8 ... up to 10th term. (Fibonacci Series)

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
x = 1
y = 1
PRINT x; y;
FOR i = 1 TO 10
    z = x + y
    PRINT z;
    x = y
    y = z
NEXT i
END
CLS
x = 1
y = 1
i = 1
PRINT x; y;
WHILE i <= 10
    z = x + y
    PRINT z;
    x = y
    y = z
    i = i + 1
WEND
END
CLS
x = 1
y = 1
i = 1
PRINT x; y;
DO WHILE i <= 10
    z = x + y
    PRINT z;
    x = y
    y = z
    i = i + 1
LOOP
END

15) 3, 10, 5, 16, 8 (Hill-stone Number).

FOR ... NEXT WHILE ... WEND DO ... LOOP
CLS
n = 3
FOR i = 1 TO 5
    PRINT n;
    IF n MOD 2 = 0 THEN
        n = n / 2
    ELSE
        n = n * 3 + 1
    END IF
NEXT i
END
CLS
n = 3
i = 1
WHILE i <= 5
    PRINT n;
    IF n MOD 2 = 0 THEN
        n = n / 2
    ELSE
        n = n * 3 + 1
    END IF
    i = i + 1
WEND
END
CLS
n = 3
i = 1
DO WHILE i <= 5
    PRINT n;
    IF n MOD 2 = 0 THEN
        n = n / 2
    ELSE
        n = n * 3 + 1
    END IF
    i = i + 1
LOOP
END

Need More ? Visit : Sequence and Series SET-2

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget