This Post Helps to Study qbasic programs with solutions. The Qbasic Notes are further updates and learners can get these complete qbasic note series from zero level to advance level. we will provide you complete solution for class 9 & 10 computer science QBasic Notes.
#1 WAP To Print Hello
CLS
PRINT “Hello”
END
#2 WAP To add Two Numbers
CLS
a = 5
b = 6
Sum = a+b
PRINT “The Sum of two numbers = “; sum
END
#3 WAP To add Two User Inputed Numbers
CLS
INPUT “Enter FIrst Number”; a
INPUT “Enter FIrst Number”; b
Sum = a+b
PRINT “The Sum of two inputted numbers = “; sum
END
#4 WAP To Find Greatest among Two Numbers [IF THEN STATEMENT]
CLS
INPUT “Enter Two Numbers”; a,b
IF a > b THEN PRINT “The greatest number is = “; a
IF b > a PRINT “The greatest number is = “; b
END
#5 WAP To Find Greatest among Two Numbers [IF THEN ELSE]
CLS
INPUT “Enter Two Numbers”; a,b
IF a > b THEN
PRINT “The greatest number is = “; a
else
PRINT “The greatest number is = “; b
END IF
END
#6 WAP To Find Greatest among Three Numbers [NESTED IF ELSE STATEMENT]
CLS
INPUT “Enter three numbers”; a, b, c
IF a > b AND a > c THEN
PRINT “The Greatest Number is =”; a
ELSEIF b > a AND b > c THEN
PRINT “The Greatest Number is =”; b
ELSE
PRINT “The Greatest Number is =”; c
END IF
END
#7 WAP To Check Weather Inputted number is odd or even.
CLS
INPUT “Enter any numbers”; n
IF n MOD 2 = 0 THEN
PRINT “The Given Number is Even”; n
ELSE
PRINT “The Given Number is Odd”; n
END IF
END
#8 WAP To Print 10 Natural numbers [Using GOTO Statement]
CLS
n = 1
TOP :
PRINT n;
n = n +1
if n<=10 then GOTO TOP
END
#9 WAP To Print Sum 10 Natural numbers [Using GOTO Statement]
CLS
n = 1
sum = 0
TOP :
sum = sum + n
n = n +1
if n<=10 then GOTO TOP
PRINT “The Sum of Ten Natural Numbers = “; sum
END
#10 WAP To Input 10 numbers and Print Their Sum [Using GOTO Statement]
CLS
count = 1
sum = 0
TOP:
INPUT “Enter Number”; n
sum = sum + n
count = count + 1
IF count <= 10 THEN
GOTO TOP
ELSE
PRINT “The Sum of Ten Inputed Numbers = “; sum
END IF
END
#11 WAP To Print first 20 Odd Numbers [Using GOTO Statement]
CLS
count = 1
odd = 1
TOP:
print odd;
odd = odd + 2
count = count + 1
IF count <= 20 THEN GOTO TOP
END
#12 WAP To Print Odd Numbers between 1 to 50 [Using GOTO Statement]
CLS
odd = 1
TOP:
print odd;
odd = odd + 2
IF odd<= 50 THEN GOTO TOP
END
#13 WAP To Print first 20 Even Numbers [Using GOTO Statement]
CLS
count = 1
even = 2
TOP:
print even;
even = even + 2
count = count + 1
IF count <= 20 THEN GOTO TOP
END
#14 WAP To Print Even Numbers between 1 to 50 [Using GOTO Statement]
CLS
even = 2
TOP:
print even;
even = even + 2
IF even<= 50 THEN GOTO TOP
END
#15 WAP To Print odd Numbers between 100 to 1 in reverse order [Using GOTO Statement]
CLS
odd = 99
TOP:
print odd;
odd = odd – 2
IF odd>= 1 THEN GOTO TOP
END
#16 WAP to check inputted number is divisible by 5 or not.
CLS
INPUT “Enter Any Number”;n
if n mod 5 = 0 then
PRINT “Given Number is DIvisible by 5”
else
PRINT”Given Number is Not Divisible by 5″
END IF
END
#17 WAP to print inputted number not zero.
CLS
INPUT “Enter Any Number”;n
if n <> 0 then
PRINT “Inputted Number is not Zero”
else
PRINT”Inputted Number is Zero”
END IF
END
#18 WAP to Display first 10 Natural Numbers.[Using FOR Loop]
CLS
FOR I = 1 TO 10
PRINT I;
NEXT I
END
#19 WAP to Display first 10 ODD Numbers.[Using FOR Loop]
CLS
odd = 1
FOR I = 1 TO 10
PRINT odd;
odd = odd + 2
NEXT I
END
#20 WAP to Display Sum of first 10 Natural Numbers.[Using FOR Loop]
CLS
sum = 0
FOR I = 1 TO 10
sum = sum + i
NEXT I
PRINT “The sum of 10 Natural Numbers is = “; sum
END
#21 WAP to Display Sum of first 10 ODD Numbers.[Using FOR Loop]
CLS
odd = 1
sum = 0
FOR I = 1 TO 10
sum = sum + odd
odd = odd + 2
NEXT I
PRINT “The Sum of first 10 Odd numbers is = “; sum
END
#22 WAP to Display Sum of ODD Numbers between 1 to 50.[Using FOR Loop]
CLS
odd = 1
sum = 0
FOR I = 1 TO 50
sum = sum + odd
odd = odd + 2
NEXT I
PRINT “The Sum of first 10 Odd numbers is = “; sum
END
#23 WAP to Display ODD Numbers from 100 to 1.[Using FOR Loop]
CLS
FOR I = 99 TO 1 STEP – 2
PRINT i;
NEXT I
END
#24 WAP to Display Factorial of Given Numbers.[Using FOR Loop]
CLS
INPUT “Enter any number”; n
fact = 1
FOR I = 1 TO n
fact = fact * I
NEXT I
PRINT “The Factorial of “; n; “is = “; fact
END
#25 WAP to Display Multiplication Table of Given Numbers.[Using FOR Loop]
CLS
INPUT “Enter any number”; n
FOR I = 1 TO 10
PRINT n; “X”; i; “=”; n*i;
NEXT I
END
#26 WAP to Display Fibonacci series upto 10th term.[Using FOR Loop]
CLS
a = 1
b = 1
PRINT a,b
FOR I = 1 TO 8
c = a+b
PRINT c,
a=b
b=c
NEXT I
END
#27 WAP to Print Given Number is Prime or Composite.[Using FOR Loop]
CLS
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”;
ELSE
PRINT n; ” is Not Prime Number”;
END IF
END
#28 WAP to Print Prime Number between 1 to 100.[Using FOR Loop]
CLS
FOR n = 1 TO 100
C = 0
FOR I = 1 TO n
IF n MOD I = 0 THEN C = C+1
NEXT I
IF C = 2 THEN PRINT n;
NEXT n
END
#29 WAP to Print First 15 Prime Numbers.[Using FOR Loop]
CLS
n = 1
Count = 1
TOP:
C = 0
FOR I = 1 TO n
IF n MOD I = 0 THEN C = C+1
NEXT I
IF C = 2 THEN
PRINT n;
Count = Count + 1
END IF
n = n + 1
IF Count <= 15 then GOTO TOP
END
#30 WAP to Print Quotient and Remainder of two divisible number.
CLS
INPUT “Enter Two Numbers”; a,b
Remainder = a MOD b
Quotient = a \ b
PRINT “The Quotient is = “; Quotient
PRINT “The Remainder is = “; Remainder
END
#31 WAP to Count Total Number of Digits in Given Inputted Number.[Using WHILE Loop]
CLS
INPUT “Enter any Numbers”; n
c = 0
WHILE n<>0
c = c +1
n = n\10
WEND
PRINT “The total number of digits = “; c
END
#32 WAP to Print Sum of Digits in Given Inputted Number.[Using WHILE Loop]
CLS
INPUT “Enter any Numbers”; num
sum = 0
WHILE num<>0
rem = num MOD 10
sum = sum + rem
num = num\10
WEND
PRINT “The Sum of digits = “; sum
END
#33 WAP to Print Reverse of Digits in Given Inputted Number.[Using WHILE Loop]
CLS
INPUT “Enter any Numbers”; num
rev = 0
WHILE num<>0
rem = num MOD 10
rev = rev * 10 + rem
num = num\10
WEND
PRINT “The Reverse of digits = “; rev
END
#34 WAP to Test Given Inputted Number is Palindrome or NOT.[Using WHILE Loop]
CLS
INPUT “Enter any Numbers”; num
chk = num
rev= 0
WHILE num<>0
rem = num MOD 10
rev = rev * 10 + rem
num = num\10
WEND
IF rev = chk THEN
PRINT “The Given Number is Palindrome = “; rev
ELSE
PRINT “The Given Number is Not Palindrome = “; rev
END IF
END
#35 WAP to Test Given Inputted Number is Armstrong or NOT.[Using WHILE Loop]
CLS
INPUT “Enter any Numbers”; num
arm = num
rev= 0
WHILE num<>0
rem = num MOD 10
rev = rev + rem ^ 3
num = num\10
WEND
IF rev = arm THEN
PRINT “The Given Number is Armstrong = “; rev
ELSE
PRINT “The Given Number is Not Armstrong = “; rev
END IF
END
#36 WAP to Print First 20 Palindrome Number.[Using GOTO & WHILE Loop]
CLS
n = 1
count = 1
TOP:
a = n
s = 0
WHILE a<>0
r = a mod 10
s = s * 10 + r
a = a\10
WEND
IF n = s THEN
PRINT n;
count = count + 1
END IF
n = n +1
IF count <= 20 THEN GOTO TOP
END
#37 WAP to Print Palindrome Number Between 100 to 500.[Using FOR & WHILE Loop]
CLS
n = 100
FOR I = 100 TO 500
a = n
s = 0
WHILE a<>0
r = a MOD 10
s = s * 10 + r
a = a\10
WEND
IF n = s THEN PRINT n;
n = n +1
NEXT I
END
#38 WAP to Print Pattern #1.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = 1 TO I
PRINT “*”;
NEXT J
PRINT
NEXT I
END
#39 WAP to Print Pattern #2.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = 1 TO I
PRINT I;
NEXT J
PRINT
NEXT I
END
#40 WAP to Print Pattern #3.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = 1 TO I
PRINT J;
NEXT J
PRINT
NEXT I
END
#41 WAP to Print Pattern #4.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = 1 TO I
S = S+1
PRINT S;
NEXT J
PRINT
NEXT I
END
#42 WAP to Print Pattern #5.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = 1 TO 5
PRINT J;
NEXT J
PRINT
NEXT I
END
#43 WAP to Print Pattern #6.[Using Nested FOR LOOP]
CLS
FOR I = 5 TO 1 STEP -1
FOR J = I TO 5
PRINT I;
NEXT J
PRINT
NEXT I
END
#44 WAP to Print Pattern #7.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = I TO 5
PRINT I;
NEXT J
PRINT
NEXT I
END
#45 WAP to Print Pattern #8.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = 5 TO I STEP -1
PRINT J;
NEXT J
PRINT
NEXT I
END
#46 WAP to Print Pattern #9.[Using Nested FOR LOOP]
CLS
FOR I = 5 TO 1 STEP -1
FOR J = 5 TO I STEP -1
PRINT J;
NEXT J
PRINT
NEXT I
END
#47 WAP to Print Pattern #10.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = I TO 1 STEP -1
PRINT J;
NEXT J
PRINT
NEXT I
END
#48 WAP to Print Pattern #11.[Using FOR LOOP]
CLS
a# = 1
FOR I = 1 TO 5
PRINT a^2;
a# = a# * 10 + 1
NEXT I
END
#49 WAP to Print Pattern #12.[Using Nested FOR LOOP]
CLS
FOR I = 1 TO 5
FOR J = 1 TO I
PRINT J MOD 2;
NEXT J
PRINT
NEXT I
END
#50 WAP to Print Pattern #13.[Using Nested FOR LOOP]
CLS
text$ = “QBASIC”
FOR I = 1 TO LEN(text$)
PRINT LEFT$(text$,I)
NEXT I
END
#51 WAP to Print Pattern #14.[Using Nested FOR LOOP]
CLS
text$ = “QBASIC”
FOR I = 1 TO LEN(text$)
PRINT RIGHT$(text$,I)
NEXT I
END
#52 WAP to Print Pattern #15.[Using Nested FOR LOOP]
CLS
text$ = “QBASIC”
FOR I = LEN(text$) TO 1 step -1
PRINT RIGHT$(text$,I)
NEXT I
END
#53 WAP to Print Pattern #16.[Using Nested FOR LOOP]
CLS
text$ = “QBASIC”
FOR I = LEN(text$) TO 1 step -1
PRINT LEFT$(text$,I)
NEXT I
END
#54 WAP to Print Pattern #17.[Using Nested FOR LOOP]
CLS
text$ = “QBASIC”
FOR I = 1 TO LEN(text$)
PRINT MID$(text$,I,1)
NEXT I
END
#55 WAP to Print Pattern #18.[Using FOR LOOP]
CLS
text$ = “QBASIC”
x = LEN(text$)
FOR I = 1 TO x – 1
PRINT Tab(I);MID$(text$,I,2)
NEXT I
END
#56 WAP to ask string/word and count total number of words.[Using FOR LOOP]
CLS
INPUT “Enter any String”; s$
wc = 1
FOR I = 1 TO LEN(s$)
b$ = MID$(s$,I,1)
IF b$ = “” THEN
wc = wc + 1
END IF
NEXT I
PRINT “Total no. of words”; wc
END
#57 WAP to ask string/word and count total number of Vowels in it.[Using FOR LOOP]
CLS
INPUT “Enter any String”; s$
vc = 1
FOR I = 1 TO LEN(s$)
b$ = MID$(s$,I,1)
c$ = UCASE$(b$)
IF c$ = “A” OR c$ = “E” OR c$ = “I” OR c$ = “O” OR c$ = “U” THEN
vc = vc + 1
END IF
NEXT I
PRINT “Total no. of Vowels”; vc
END
#58 WAP to ask string/word and print reverse of it.[Using FOR LOOP]
CLS
INPUT “ENTER A STRING”; S$
FOR I = LEN(S$) TO 1 STEP -1
M$ = MID$(S$, I, 1)
REV$ = REV$ + M$
NEXT I
PRINT REV$
END
Download Complete Code click on link below use password “RitNote”



