WRITE THE
PROGRAMS FOR THE FOLLOWINGS
1. Write a program to input three different numbers
and print their sum and product.
CLS
INPUT
"Enter first number";n1
IPNUT
"Enter second number";n2
IPNUT
"Enter third number";n3
PRINT "SUM
= ";n1+n2+n3
PRINT
"PRODUCT = ";n1*n2*n3
END
2.
WRITE A PROGRAM TO INPUT THE LENGTH AND PRINT THE PERIMETER OF A SQUARE
CLS
IPNUT "ENTER LENGTH";L
PRINT "PERIMETER = ";4*L
END
3.
WRITE A PROGRAM TO INPNUT NEPALI CURRENCY AND CONVERT IT INTO INDIAN CURRENCY.
CLS
INPUT "ENTER NEPALI CURRENCY";N
PRINT "EQUIVALENT INDIAN CURRENCY
=";N/1.6
END
4.
WRITE A PROGRAM TO ENTER A NUMBER AND CHECK WHETHER TH NUMBER IS PALINDROME OR
NOT.
CLS
INPUT "ENTER A NUMBR";N
T=N
WHILE N>0
R=N
MOD 10
REV=REV*10+R
N=INT(N/10)
WEND
IF T=REV THEN
PRINT
"THE NUMBER IS PALINDROME"
ELSE
PRINT
"THE NUMBER IS NOT PALINDROME"
END IF
END
5.
WRITE A PROGRAM TO INPUT A NUMBER AND CHECK WHETHER THE NUMBER IS ARMSTRONG OR
NOT.
CLS
INPUT "ENTER A NUMBER";N
T=N
WHILE N>0
R
= R MOD 10
ARM
= ARM + R ^ 3
N
= N \ 10
WEND
IF ARM = T THEN
PRINT
"THE NUMBER IS ARMSTRONG"
ELSE
PRINT
"THE NUMBER IS NOT ARMSTRONG"
END IF
END
6.
WRITE A PROGRAM TO CHECK WHETHER A STRING IS PALINDROME OR NOT.
CLS
INPUT "ENTER A WORD";W$
FOR I = LEN(W$) TO 1 STEP -1
REV$
= REV$ + MID$(W$,I,1)
NEXT I
IF W$ = REV$ THEN
PRINT
"PALINDROME"
ELSE
PRINT
"NOT PALINDROME"
END IF
END
7.
WRITE A PROGRAM TO CHECK WHETHER AN INPUT NUMBER IS PRIME OR COMPOSITE.
CLS
INPUT "ENTER A NUMBER";N
FOR I = N -1 TO 2 STEP -1
IF
N MOD I = 0 THEN
PRIME
= 0
GO
TO DOWN
ELSE
PRIME
=1
END
OF
NEXT I
DOWN:
IF PRIME = 1 OR N =1 OR N =2 THEN
PRINT
"PRIME"
ELSE
PRINT
"COMPOSITE"
END IF
END
8.
WRITE A PROGRAM TO DISPLAY "SWARNIM PUBLICATION PVT LTD" 10 TIMES
USING WHILE....WEND
CLS
I = 1
WHILE I<=10
PRINT
"SWARNIM PUBLICATION PVT LTD"
I
= I + 1
WEND
END
9.
WRITE A PROGRAM TO PRINT FIRST 25 NUMBERS USING DO...LOOP
CLS
I = 2
DO
PRINT I,
I = I + 2
LOOP WHILE I <= 50
END
10.
WRITE A PROGRAM TO FIND OUT FACTORIAL OF A GIVEN NUMBER USING FOR... NEXT
CLS
INPUT "ENTER A NUMBER";N
F = 1
FOR I = 1 TO N
F = F * I
NEXT I
PRINT N;"! = ";F
END
11.
WRITE A PROGRAM TO INPUT MARKS OF ALL YOUR SUBJECTS AND PRINT TOTAL,
PERCENTAGE, RESULT AND DIVISION
CLS
INPUT "MARKS IN NEPALI";N
INPUT "MARKS IN SCIENCE";S
INPUT "MARKS IN SOCIAL";SO
INPUT "MARKS IN ENGLISH";E
INPUT "MARKS IN MATHS";M
INPUT "MARKS IN OPT";O
INPUT "MARKS IN HPE";H
INPUT "MARKS IN COMPUTER";C
IF N>=40 AND S>=40 AND SO>=40
AND E>=40 AND M>=40 AND O>=40 AND H>=40 AND C>=40 THEN
RESULT$="PASS"
ELSE
RESULT$="FAIL"
END IF
TOTAL = N + S + SO + E + M + O + H + C
PERCENT = (TOAL / 800) * 100
IF PERCENT >=80 THEN
DIV$
= "DISTINCTION"
ELSEIF PERCENT >=60 THEN
DIV$
= "FIRST"
ELSEIF PERCENT >= 45 THEN
DIV$
= "SECOND"
ELSE
DIV$
= "THIRD"
END IF
PRINT "TOTAL: ";TOTAL
PRINT "PERCENT: ";PERCENT
PRINT "DIVISION: ";DIV$
PRINT "RESULT: ";RESULT$
END
12.
WRITE A PROGRAM TO FIND THE AREA OF A CUBE. [HINT: A=6L2]
CLS
INPUT "ENTER THE LENGTH";L
PRINT "AREA = "; 6 * L ^ 2
END
13.
WRITE A PROGRAM TO FIND THE CURVED SURFACE AREA OF A SQUARE.[A=2πRH]
CLS
PI = 22/7
INPUT "ENTER THE RADIUS";R
INPUT "ENTER THE HEIGHT";H
PRINT "CURVED SURFACE AREA =
";2 * PI * R * H
END
14.
WRITE A PROGRAM TO FIND THE TOTAL SURFACE AREA OF A CYLINDER.[A=2πR(R+H)]
CLS
PI = 22/7
INPUT "ENTER THE RADIUS OF BASE OF
CYLINDER";R
INPUT "ENTER THE HEIGHT OF THE
CYLINDER";H
PRINT "SURFACE AREA = "; 2 * PI
* R * (R + H)
END
15.
WRITE A PROGRAM TO CALCULATE THE DISTANCE TRAVELLED BY BODY. [S=UT+1/2AT2]
CLS
INPUT "ENTER THE INITIAL
VELOCITY"; U
INPUT "ENTER TIME";T
INPUT "ENTER ACCELERATION";A
PRINT "DISTANCE TRAVELLED = ";
U * T + (1/2) * A * T ^ 2
END
16.
WRITE A PROGRAM TO INPUT THE TEMPERATURE IN FAHRENHEIT AND DISPLAY IN DEGREE
CELSIUS.
CLS
INPUT "TEMPERATURE IN
FAHRENHEIT";F
PRINT "TEMPERATURE IN CELCIUS =
"; ((F - 32) * 5)/9
END
6.
WRITE PROGRAM TO GENERATE FOLLOWING SERIES
A.
2, 4, 6, 8......... UP TO 10TH TERM
CLS
FOR I = 2 TO 20 STEP 2
PRINT I;
NEXT I
END
B.
1, 8, 27, 64, .......... UP TO 10TH TERM
CLS
FOR I = 1 TO 10
PRINT I^3;
NEXT I
END
C.
100, 98, 96, 94.... UP TO 10TH TERM
CLS
I = 1
A = 100
WHILE I<=10
PRINT A;
A = A - 2
I = I + 1
WEND
END
D.
1, 4, 9, ......... UP TO 10TH TERM
CLS
FOR I = 1 TO 10
PRINT I ^ 2;
NEXT I
END
E.
5, 25, 125 .......... UP TO 10TH TERM
CLS
FOR I = 1 TO 10
PRINT 5 ^ I;
NEXT I
END
F.
1, 2, 3, 6, 11, 20, 37.... UP TO 10TH TERM
CLS
A = 1
B = 2
C = 3
FOR I = 1 TO 10
D = A + B + C
SWAP A, B
SWAP B, C
SWAP C, D
PRINT D;
NEXT I
END
G.
5, 16, 8, 4, 2, 1, 4, 2, 1, 4
CLS
A = 5
FOR I = 1 TO 10
PRINT A;
IF A MOD 2 = 0 THEN
A = A \ 2
ELSE
A = A * 3 + 1
END IF
NEXT
END
H.
66666, 6666, 666, 66, 6.
CLS
A = 66666
FOR I = 1 TO 5
PRINT A;
A = A \ 10
NEXT I
END
I.
2, 8, 18, 32, ........ UP TO 10TH TERM
CLS
A = 2
B = 6
FOR I 1 TO 10
PRINT A;
A = A + B
B = B + 4
NEXT I
END
J.
7, 22, 11, 34, 17, 52, 26, 13, 40, 20.
CLS
A = 7
FOR I = 1 TO 10
PRINT A;
IF A MOD 2 = 0 THEN
A = A \ 2
ELSE
A = A * 3 + 1
END IF
NEXT I
END
K.
1/2, 2/3, 3/4, ...... UP TO 10TH TERM
CLS
FOR I = 1 TO 10
PRINT I; "/"; I + 1;
NEXT I
END
7.
WRITE A PROGRAM TO DISPLAY THE GICEN OUTPUT.
A.
54321
4321
321
21
1
CLS
FOR I = 5 TO 1 STEP -1
FOR J = I TO 1 STEP -1
PRINT J;
NEXT J
PRINT
NEXT I
END
B.
11111
2222
333
44
5
CLS
FOR I = 1 TO 5
FOR J = 5 TO I STEP -1
PRINT I;
NEXT J
PRINT
NEXT I
END
C.
5
54
543
5432
54321
CLS
FOR I = 5 TO 1 STEP -1
FOR J = 5 TO I STEP -1
PRINT J;
NEXT J
PRINT
NEXT I
END
D.
1
13
135
1357
CLS
FOR I = 1 TO 7 STEP 2
FOR J = 1 TO I STEP 2
PRINT J;
NEXT J
PRINT
NEXT I
END
E.
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
CLS
FOR I = 0 TO 4
FOR J = 1 TO 3
PRINT I +J;
NEXT J
PRINT
NEXT I
END
F.
1
33
555
7777
CLS
FOR I = 1 TO 7 STEP 2
FOR J = 1 TO I STEP 2
PRINT I;
NEXT J
PRINT
NEXT I
END
how to write a program that prints word in a format that all the letters in the word are capital except the beginning and the ending one
ReplyDeleteCLS
DeleteINPUT a$
a$ = LCASE$(LTRIM$(RTRIM$(a$)))
p = LEN(a$)
x$ = UCASE$(MID$(a$, 1, 1))
z$ = UCASE$(MID$(a$, p, 1))
FOR i = 2 TO p - 1
y$ = y$ + MID$(a$, i, 1)
NEXT i
PRINT x$ + y$ + z$
END
How to write a program to get the elements of 3×3 matrix A and B and add them
Deletecls
Deleteprint 333
333
333
sike
cls
Deleteprint 333
333
333
sike
Cls
DeleteInput a$
a$ = LCase$(a$)
b$ = UCase$(Mid$(a$, 1, 1))
c$ = Mid$(a$, 2, Len(a$) - 1)
d$ = UCase$(Mid$(a$, Len(a$), 1))
e$ = b$ + c$ + d$
Print e$
meropaper c program and Qbasic notes here
ReplyDeleteWhile the government coordinate advances program, the division of instruction is the loan specialist. cheap essay writing services
ReplyDeleteHow to find this series 123454321, 1234321, 12321, 121, 1
ReplyDeleteHow to find greatest among four numbers?
ReplyDeletethere are two way
Delete1. indivisual camparison
2. array method
which one do you need?
How to find the pattern
ReplyDelete*
***
*****
*******
*****
***
*
FOR i% = 1 TO 5
DeletePRINT STRING$(i%, "*")
NEXT i%
CLS
DeleteINPUT "ENTER FIRST NUMBER";N1
IPNUT "ENTER SECOND NUMBER";N2
IPNUT "ENTER THIRD NUMBER";N3
PRINT "SUM = ";N1+N2+N3
PRINT "PRODUCT = ";N1*N2*N3
END
100 98 96 .........2
ReplyDeleteCLS
DeleteA=100
FOR I= 98 TO 2 STEP-2
A=A-2
NEXT I
END
How to find pattern
ReplyDelete1
11
111
1111
11111
CLS
Deletea=1
Print a
a=a*10+1
Next I
END
CLS
DeleteA=1
FOR I = 1 TO 5
PRINT A;
A= A*10+1
NEXT I
END
CLS
DeleteFOR I = 1 TO 5
PRINT "1"
NEXT I
END
cls
Deletefor counter = 1 to 5
for count = 1 to counter
print "1";
next count
print" "
next counter
end
cls
Deletea$="11111"
for i=1 to 5
print left$(a$,i)
next i
end
2,5,9,14....1oth term
ReplyDeleteCls
DeleteA=2
B=3
For I=1 to 10
A=A+B
B=B+1
Print A
Next I
End
How to find the pattern
ReplyDelete* * * *
* *
* *
* * * *
How to print the pattern
ReplyDelete1 11 111 1111 11111
CLS
DeleteA=1
FOR I =1 to 5
Print A
A=A*10+1
Next I
End
cls
Deletea= 1
for i = 1 to 5
print a
a= a*10 +1
next i
end
CLS
Deletea = 1
For I = 1 to 5
PRINT a;
a = a * 10 + 1
NEXT I
END
WAP to input any number and display whether it is positive, negative or neutral using SELECT CASE statement
ReplyDelete15 14 13 12 11
ReplyDelete10 9 8 7
6 5 4
3 2
1
who knows reply
CLS
Deletea = 15
FOR i = 5 TO 1 STEP -1
FOR j = i TO 1 STEP -1
PRINT a;
a = a - 1
NEXT j
PRINT
NEXT i
END
AWESOME PROGRAMSSSS
ReplyDeletePOKHARA
ReplyDeleteOKHAR
KHA
H
how to print them?
CLS
DeleteA$="POKHARA"
C=LEN(A$)
FOR I= 1 TO 4
PRINT MID$(A$,I,C)
C=C-2
NEXT I
END
how to print
ReplyDelete5
40
300
2000
10000
cls
ReplyDeletea=5
b=1
for i=1 to 5
print a*b
a=a-1
b=b*10
next i
end
How to write program to calculate the area and perimeter of a rectangle
ReplyDeleteFast
ReplyDeletePlz
How to write a program to read ten different names and print all names starting with "A","B" or"M".(Using READ-DATA Statement)
ReplyDeleteData success,aman,manoj,bibek
DeleteFor i = 1 To 4
Read n$
n$ = LCase$(n$)
a$ = Mid$(n$, 1, 1)
If a$ = "a" Or a$ = "b" Or a$ = "m" Then Print n$
Next i
How to write a program to print all characters represented by ASCII codes from 0 to 255.(Using function procedure.)
ReplyDeleteHow to write a program to change the system time by "10:30 A.M"
ReplyDeletewrite a program to print 1 23 456 78910 11121314155
ReplyDeleteThank you for your beautiful answers.
ReplyDeleteIt gave me big support.
How to print neon numbers in qbasic
ReplyDeleteHow to display middle name .org a person
ReplyDeleteWAP to input string and count no of vowels
ReplyDeleteHow to find prime and composite in easiest way?
ReplyDeleteHow tofind program to enter a word and display I in lowercase?
ReplyDeleteCLS
DeleteA$=I
BS=LCASE$(I)
PRINT B$
END
CLS
ReplyDeleteHow to print temperature in Celsius if the temperature enters in Kelvin
ReplyDeleteCLS
DeleteInput "Enter temperature in celcius";n!
let a! = n!+273
print a!
end
CLS
ReplyDeleteA$
BS=LCASE$(|)
PRINT B$
END
how to write a program to calculate (a2-b2), where a=9 and b=6.
ReplyDeleteHow can we write a program to enter any number and find out whether it is negative or positive
ReplyDeleteInput A
DeleteIf Ao Then PRINT “Positive”
End
SHEKHAR
ReplyDeleteSHEKHA
SHEKH
SHEK
SHE
SH
S
HOW TO PRINT IT?
how print it
DeleteA book cost rs425. Write the program to calculate and display price of 13 books
ReplyDeleteCLS
DeleteINPUT"ENTER THE COST OF ONE BOOK ";C
PRINT"THE COST OF THIRTHEEN BOOKS =";C*13
END
thanks so much
ReplyDeleteWap to display characters of the ASCII code from 0 to 255(qbasic)
ReplyDeletereally need solution
Wap to convert dollar into nepales to currency
ReplyDeleteWap to convert dollar into nepales to currency
ReplyDelete11,22,33....220
ReplyDeleteWAP that displays division of students on the basis of their percentage
ReplyDeleteTo display the below pattern
ReplyDeleteEDUCATION
DUCATIO
UCATI
CAT
A
enter 10 different numbers and find the sum of 3rd and 5th element
ReplyDeleteKATHMANDU
ReplyDeleteATHMAND
THMAN
HMA
M
HOW TO PRINT IT
Tu
ReplyDeleteHow to find pattern
ReplyDelete8,6,32,64......upto 15th term
cls
Deletea=8
for i=1 to 15
print a
a=a*2
next i
end
Raju verma
ReplyDeleteHow to print
ReplyDelete1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
Ghostwriting services turn your biography into an inspiration book. If you have a success story that you think might benefit others Hire Biography Writing Services now and get it published they transcript your words, your voice, and your biography into a successful book.
ReplyDeleteSHEKHAR
DeleteSHEKHA
SHEKH
SHEK
SHE
SH
S
HOW TO PRINT IT?