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

Articles by "qbasic programs"
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? पब्जी गेम

QBASIC Program to print the given string in reverse order

CLS
INPUT "Enter any String "; s$
FOR i = LEN(s$) TO 1 STEP -1
    r$ = MID$(s$, i, 1)
    b$ = b$ + r$
NEXT i
PRINT "Reverse Order = "; b$
END

Using SUB .... END SUB

DECLARE SUB revf(s$)
CLS
INPUT "Enter any String "; s$
CALL rev(s$)
END

SUB rev (s$)
    FOR i = LEN(s$) TO 1 STEP -1
        r$ = MID$(s$, i, 1)
        b$ = b$ + r$
    NEXT i
    PRINT "Reverse Order = "; b$
END SUB



Using FUNCTION ... END FUNCTION

DECLARE FUNCTION rev$(s$)
CLS
INPUT "Enter any string "; s$
re$ = rev$(s$)
PRINT "Reverse Order = "; re$
END

FUNCTION rev$ (s$)
    FOR i = LEN(s$) TO 1 STEP -1
        r$ = MID$(s$, i, 1)
        b$ = b$ + r$
    NEXT i
    rev$ = b$
END FUNCTION


Video Tutorial in Nepali Language

QBASIC program to print whether the given number is Prime or Composite.

CLS
INPUT "Enter any Number "; n
FOR i = 1 TO n
    IF n MOD i = 0 THEN c = c + 1
NEXT i
IF c = 2 THEN
    PRINT "Prime Number"
ELSE
    PRINT "Composite Number"
END IF
END

By Using SUB ... END SUB
DECLARE SUB Prime(n)
CLS
INPUT "Enter any number : "; n
CALL Prime(n)
END

SUB Prime (n)
    FOR i = 1 TO n
        IF n MOD i = 0 THEN c = c + 1
    NEXT i
    IF c = 2 THEN
        PRINT "Prime Number"
    ELSE
        PRINT "Composite Number"
    END IF
END SUB
By Using FUNCTION ... END FUNCTION
DECLARE FUNCTION Prime(n)
CLS
INPUT "Enter any number : "; n
r = Prime(n)
IF r = 2 THEN
    PRINT "Prime Number"
ELSE
    PRINT "Composite Number"
END IF
END

FUNCTION Prime (n)
    FOR i = 1 TO n
        IF n MOD i = 0 THEN c = c + 1
    NEXT i
    Prime = c
END SUB


Video Tutorial in Nepali Language


 Visit YouTube Channel : Technical School


1) WAP to display "Hello World" on the screen
CLS
PRINT "Hello World!"
END
 
2) WAP to display your name address and school name.
CLS
CLS
PRINT "Your name"
PRINT "Your Address"
PRINT "Your school name"
END

3) WAP display the sum of 20, 30 and 10.
CLS
CLS
a = 20
b = 30
c = 10
add = a + b + c
PRINT "The sum = "; add
END

 4) Write a program to get 2 numbers from the user and display the sum.
CLS
CLS
INPUT "Enter first number "; x
INPUT "Enter second number "; y
add = x + y
PRINT "The sum = "; add
END

5) WAP to enter length and breadth of room and print the area of room. [Hints: A=(l*b)]
CLS
CLS
INPUT "Enter length of room "; l
INPUT "Enter breadth of room"; b
a = l * b
PRINT "Area of room = "; a
END

6) WAP to enter length and breadth of room and display the perimeter of room. [Hints: P=2(l+b)]
CLS
INPUT "Enter length of room "; l
INPUT "Enter breadth of room"; b
p = 2 * (l + b)
PRINT "Area of room = "; p
END

7) WAP to enter radius of a circle; then calculate and display its area. [Hints: A=πr2]
CLS
CLS
INPUT "Enter the radius of circle "; r
a = (22 / 7) * r ^ 2
PRINT "Area of Circle = "; a
END

8) WAP to input temperature in Celsius and calculate its temperature in Fahrenheit. [Hints: F=9/5*c+32]
CLS
INPUT "Enter temperature in Celsius "; c
f = 9 / 5 * c + 32
PRINT "Temperature in Fahrenheit = "; f
END

9) WAP to input temperature in Fharenheit and calculate its temperature in Celsius. [Hints: C=(F-32)*5/9]
CLS
INPUT "Enter temperature in Fahrenheit "; f
c = (f - 32) * 5 / 9
PRINT "Temperature in Celsius = "; c
END

10) WAP to enter Principal (P), Time (T) and Rate (R) and display simple interest. [Hints: I=PTR/100]
CLS
INPUT "Enter P "; p
INPUT "Enter T "; t
INPUT "Enter R "; r
i = p * t * r / 100
PRINT "Simple Interest = "; i
END

11) WAP to enter length, breadth and height and print volume. [Hints: v = l*b*h]
CLS
INPUT "Enter Length "; l
INPUT "Enter Breadth "; b
INPUT "Enter Height "; h
v = l * b * h
PRINT "Volume = "; v
END
   
12) WAP to enter distance into K.M and convert it into M. [Hints: 1km = 1000m]
CLS
INPUT "Enter distance in K.M "; km
m = km * 1000
PRINT km; " K.M = "; m; "M"
END
   13) WAP to input name of item, price of item and quantity then calculate the amount [Amount = price * quantity]
CLS
INPUT "Enter the name of Item "; iname$
INPUT "Enter Price Per Unit "; p
INPUT "Enter Quantity "; q
a = p * q
PRINT "Total Amount = "; a
END
    14)  WAP that ask you to input a number; then calculate the square and square root of that number. 
CLS
INPUT "Enter a Number "; n
PRINT "Square = "; n ^ 2
PRINT "Square Root = "; SQR(n)
END
    15)  WAP to calculate the area of triangle. [Hints: A=1/2(b*h)] 
CLS
INPUT "Enter Breadth "; b
INPUT "Enter Height "; h
a = 1 / 2 * (b * h)
PRINT "Area of Triangle = "; a
END
   16)  WAP to calculate the area of triangle. [Hints: A=1/2(b*h)] 
CLS
INPUT "Enter Breadth "; b
INPUT "Enter Height "; h
a = 1 / 2 * (b * h)
PRINT "Area of Triangle = "; a
END
   17)  WAP to calculate the area of 4 walls. [Hints: A = 2H(L + B)
CLS
INPUT "Enter Length "; l
INPUT "Enter Breadth "; b
INPUT "Enter Height "; h
a = 2 * h * (l + b)
PRINT "Area of 4 wall = "; a
END
    17)  WAP to print the area of triangle when 3 sides are given.
CLS
INPUT "Length of First Side "; a
INPUT "Length of Second Side "; b
INPUT "Length of Third Side "; c
S = (a + b + c) / 2
ar = (S * (S - a) * (S - b) * (S - c)) ^ 1 / 2
PRINT "Area of Triangle = "; ar
END
    18)  WAP to enter time in second and convert into hour minute and second. 
CLS
INPUT "Enter time in second "; s
h = s \ 3600
s = s MOD 3600
m = s \ 60
s = s MOD 60
PRINT "Hour = "; h
PRINT "Minute = "; m
PRINT "Second ="; s
END
   Visit YouTube Channel : https://www.youtube.com/technicalschoolnepal
Face Book Page : https://www.facebook.com/technicalschoolnepal


1)
PROGRAMMING
PROGRAMMIN
PROGRAMMI
PROGRAMM
PROGRAM
PROGRA
PROGR
PROG
PRO
PR
P

CLS
a$ = "PROGRAMMING"
FOR i = LEN(a$) TO 1 STEP -1
    PRINT LEFT$(a$, i)
NEXT i
END
2)
5
55
555
5555
55555


CLS
n = 5
FOR i = 1 TO 5
    PRINT n
    n = n * 10 + 5
NEXT i
END
3)
  P
 EPA
NEPAL




CLS
S$ = "NEPAL"
r = 1
t = 10
FOR i = 3 TO 1 STEP -1
    PRINT TAB(t); MID$(S$, i, r)
    r = r + 2
    t = t - 1
NEXT i
END
4)

123456787654321
 1234567654321
  12345654321
   123454321
    1234321
     12321
      121
       1


CLS
n# = 11111111
s = 10
FOR i = 1 TO 8
    PRINT SPACE$(s); n# * n#
    n# = n# \ 10
    s = s + 1
NEXT i
END
5)

1
2 3
4 5 6
7 8 9 10
11 12 13 14 15



CLS
c = 1
FOR i = 1 TO 5
    FOR j = 1 TO i
        PRINT c;
        c = c + 1
    NEXT j
    PRINT
NEXT i
END
5)

1 3 5 7 9
1 3 5 7
1 3 5
1 3
1

CLS
FOR i = 9 TO 1 STEP -2
    FOR j = 1 TO i STEP 2
        PRINT j;
    NEXT j
    PRINT
NEXT i
END
5)

9
9 7 
9 7 5
9 7 5 3 
9 7 5 3 1
CLS
FOR i = 9 TO 1 STEP -2
    FOR j = 9 TO i STEP -2
        PRINT j;
    NEXT j
    PRINT
NEXT i
END
5)

1
1 3
1 3 5
1 3 5 7
1 3 5 7 9
CLS
FOR i = 1 TO 9 STEP 2
    FOR j = 1 TO i STEP 2
        PRINT j;
    NEXT j
    PRINT
NEXT i
ENDa

Patterns in QBASIC SET-1
Visit My YouTube Channel : https://www.youtube.comtechnicalschoolnepal 
Facebook page : www.facebook.com/technicalschoolnepal
Complete QBASIC Course
Go to Practice Time


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

MKRdezign

Contact Form

Name

Email *

Message *

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