TecMK

I aim to provide quality tech articles and posts to the viewers.

  • Home
  • PC Builds
    • $400 Mini-ITx HTPC + Gaming PC
    • $350-$400 Gaming PC
    • $500 Workstation + Gaming PC
  • Smartphones
    • Redmi Note 5 and Note 5 Pro
  • Featured
  • Versus Comparaison
    • Xbox One X vs PS4 PRO
  • Home
  • PC Builds
    • $400 Mini-ITx HTPC + Gaming PC
    • $350-$400 Gaming PC
    • $500 Workstation + Gaming PC
  • Best Software
  • Smartphones
    • Redmi Note 5 and Note 5 Pro
  • Featured
  • Versus Comparaison
    • Xbox One X vs PS4 PRO
  • Uncategorized

Easy QBasic Programs for Beginners

 February 11, 2018     Programming, Qbasic, Qbasic for beginners, Qbasic Programs     1 comment   

Easy QBasic Programs for Beginners

1) To print Hello World-
CLS
PRINT "Hello World"
END

2) To enter your name and print it-
CLS
INPUT "Enter your name : ";a$
PRINT "Your name is : ";a$
END

3) Simple Menu Based Calculator
CLS
PRINT "1. Add"
PRINT "2. Subtraction"
PRINT "3. Multiply"
PRINT "4. Division"
PRINT "5. Exit"
INPUT "Enter your choice:"; a
INPUT "Enter first number:"; x
INPUT "Enter second number:"; y
SELECT CASE a
    CASE 1: PRINT "Sum = "; x + y
    CASE 2: PRINT "Difference = "; x - y
    CASE 3: PRINT "Product = "; x * y
    CASE 4: PRINT "Quotient = "; x / y
    CASE 5: PRINT "Exiting..."
        SLEEP
        END
    CASE ELSE: PRINT "Invalid Entry"
END SELECT
END

4)Armstrong number
CLS
INPUT n
a = n
s = 0
WHILE n <> 0
    r = n MOD 10
    s = s + r ^ 3
    n = n \ 10
WEND
IF a = s THEN
    PRINT a; "IS ARMSTRONG"
ELSE
    PRINT a; "IS NOT ARMSTRONG"
END IF
END

5) Automorphic Number
CLS
INPUT a
s = 0
m = a ^ 2
WHILE m <> 0
    s = s + 1
    m = m \ 10
WEND
IF m = m mod 10 ^ s THEN
PRINT "Automorphic"
ELSE
PRINT "Not Automorphic"
END IF
END

6)Prime Number
CLS
LET M$ = "Y"
DO
    INPUT "ENTER ANY NUMBER"; N
    C = 0
    FOR I = 1 TO N
        IF N MOD I = 0 THEN C = C + 1
    NEXT I
    IF C = 2 THEN
        PRINT N; "IS PRIME NUMBER"
    ELSEIF C = 1 THEN
        PRINT N; "IS NEITHER PRIME NOR COMPOSITE"
    ELSE
        PRINT N; "IS COMPOSITE NUMBER"
    END IF
    INPUT "Do you want to continue?"; M$
LOOP WHILE M$ = "Y" OR M$ = "y"
END

7)Complex calculator (Menu Based)
CLS
DO
PRINT "1) ADD"
PRINT "2) SUBTRACT"
PRINT "3) MULTIPLY"
PRINT "4) DIVIDE"
PRINT "5) PRINT SQUARE OF THE NUMBER"
PRINT "6) PRINT CUBE OF THE NUMBER"
PRINT "7) SQUARE ROOT"
PRINT "8) CUBE ROOT"
INPUT "Enter Your Choice : ";a
ON a GOSUB 1,2,3,4,5,6,7,8
INPUT "Do you want to continue?(Y/N)";A$
LOOP WHILE A$="Y" OR A$="y"
END
1:
INPUT "Enter first number : ";a
INPUT "Enter second number : ";b
PRINT "Sum = ";a+b
RETURN
2:
INPUT "Enter first number : ";a
INPUT "Enter second number : ";b
PRINT "Differenece = ";a-b
RETURN
3:
INPUT "Enter first number : ";a
INPUT "Enter second number : ";b
PRINT "Product = ";a*b
RETURN
4:
INPUT "Enter first number : ";a
INPUT "Enter second number : ";b
PRINT "Quotient = ";a/b
RETURN
5:
INPUT "Enter number : ";a
PRINT "Square = ";a^2
RETURN
6:
INPUT "Enter number : ";a
PRINT "Cube = ";a^3
RETURN
7:
INPUT "Enter number : ";a
PRINT "Square Root = ";a^(1/2)
RETURN
8:
INPUT "Enter number : ";a
PRINT "Cube Root = ";a^(1/3)
RETURN

8) Area of rectangle, square, circle, triangle
CLS
DO
    INPUT "Enter your choice (1/2/3/4)"; a
    ON a GOSUB rect, squa, circ, tria
    INPUT "Do you want to continue"; a$
LOOP WHILE a$ = "Y" OR a$ = "y"
END
rect:
INPUT "Enter Length:"; l
INPUT "Enter Breadth:"; b
PRINT "Area = "; l * b
RETURN
squa:
INPUT "Enter Side:"; s
PRINT "Area = "; s ^ 2
RETURN
circ:
INPUT "Enter Redius:"; r
PRINT "Area = "; 22 / 7 * r * r
RETURN
tria:
INPUT "Enter Base:"; b
INPUT "Enter Height:"; h
PRINT "Area = "; 1 / 2 * b * h
RETURN

9) Simple Interest
CLS
INPUT "Enter Principal, Rate and Time";p,r,t
PRINT "Simple Interest = ";(p*r*t)/100
END

10) Perimeter of Rectangle
CLS
INPUT "Enter Length and Breadth";l,b
PRINT "Perimeter = ";2*(l+b)
END

11) Perimeter of Square
CLS
INPUT "Enter Side";s
PRINT "Perimeter = ";s*4
END

12) Circumference
CLS
INPUT "Enter Radius:"; r
PRINT "Area = "; 2 * r * 22 / 7
END
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Home

1 comment:

  1. Anonymous12 April 2022 at 06:46

    Easy Qbasic Programs For Beginners ~ Tecmk >>>>> Download Now

    >>>>> Download Full

    Easy Qbasic Programs For Beginners ~ Tecmk >>>>> Download LINK

    >>>>> Download Now

    Easy Qbasic Programs For Beginners ~ Tecmk >>>>> Download Full

    >>>>> Download LINK AN

    ReplyDelete
    Replies
      Reply
Add comment
Load more...

Popular Posts

  • Top 5 Best Free Video Editing Software in 2018
    Top 5 Best Free Video Editing Software in 2018: Don't have the budget to spend $20/month for expensive video editing software like Ado...
  • $500 Workstation + Gaming PC
    As we all know that GPU prices are just absurd right now, so I decided to build a used Workstation + Gaming PC without breaking the bank.  ...
  • Easy QBasic Programs for Beginners
    Easy QBasic Programs for Beginners 1) To print Hello World- CLS PRINT "Hello World" END 2) To enter your name and print it...

Categories

  • $400 Mini-ITx HTPC + Gaming PC
  • $500 workstation + gaming pc
  • best console
  • best free video editor
  • best game
  • best game for low end laptops
  • Best Games for Low-End Hardware
  • best games for potato pc
  • best linux
  • best linux distribution
  • best linux distro for beginners
  • best pc games
  • best smartphone under 15000
  • best steam alternative
  • best video editor
  • budget editing pc
  • Budget gaming
  • budget gaming pc
  • budget pc
  • budget workstation
  • cheap gaming pc
  • cheap htpc
  • cheap pc
  • Cheap workstation.PC
  • cooler master elite 130
  • e5-2670
  • games for low end pc
  • games for potato pc
  • Gaming PC
  • gog
  • green man gaming
  • gtx770
  • HTPC
  • humble store
  • mac alternative
  • note 5
  • note 5 pro
  • origin
  • PC
  • pc games
  • PC gaming
  • powerful console
  • Programming
  • ps4 pro
  • Qbasic
  • Qbasic for beginners
  • Qbasic Programs
  • Redmi
  • Redmi Note 5
  • Redmi note 5 pro
  • ryzen 3
  • ryzen 3 2200g
  • ryzen 5 2400g
  • ryzen apu
  • smartphone
  • steam
  • steam alternative
  • Top 10 Best Games for Low-End Hardware
  • Top 5 Best Free Video Editing Software in 2018
  • Top 5 Best Video Editing Software in 2018
  • top 5 steam alternatives
  • top 7 best linux
  • top 7 best linux distributions
  • uplay
  • video editor
  • windows alternative
  • xbox one x
  • xbox one x vs ps4 pro
  • Xbox vs PS4
  • Xiaomi
  • xiaomi note 5
  • xiaomi note 5 pro

Pages

  • Home
  • Best Software

Blog Archive

  • February 2018 (10)

Search This Blog

Powered by Blogger.

Report Abuse

Featured Post

$400 Mini-ITx HTPC + Gaming PC

$400 Mini-ITx HTPC + Gaming PC :   Want a cheap Small & Compact PC for your living room? Don't Have the space for a full size...

Posts
Atom
Posts
Comments
Atom
Comments

Pages

  • Privacy Policy

Disclaimer

  • Disclaimer

Copyright © TecMK | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates