Wednesday, October 2, 2019

Qbasic to find reverse of digit

CLS
INPUT "Enter any number"; N

S = 0
WHILE N<> 0
R = N MOD 10
S = S*10+R
N = N\10
WEND
PRINT "Reverse of digits="; S

END

Qbasic to find product of digit

CLS
INPUT "Enter any number'; N

P = 1
WHILE N<> 0
R = N MOD 10
P = P*R
N = N\10
WEND
PRINT "Product of digits="; P

END

Qbasic to find sum of digit

CLS
INPUT "Enter any number"; N

S = 0
WHILE N<> 0
R = N MOD 10
S = S+R
N = N\10
WEND
PRINT "Sum of digits="; S

END

Qbasic to print greatest among three numbers

CLS
INPUT "Enter any three number"; 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

Qbasic to find odd or even

CLS
INPUT "Enter any number"; N

IF N MOD 2 = 0 THEN
PRINT "The number is even"

ELSE
PRINT "The number is odd"

END IF
END

Qbasic to display Positive,Negative or Zero

CLS
INPUT "Enter any number"; N

IF N>0 THEN
PRINT "The number is positive"

ELSEIF N<0 THEN
PRINT " The number is negative"

ELSE
PRINT "The number is zero"

END IF
END

Qbasic to find volume of cylinder

CLS
INPUT "Enter the radius"; R

INPUT "Enter the height"; H
V =  22/7*R^2*H
PRINT "Volume of cylinder="; V
END 

Digital Footprint

Computer technology is a technology that instead of building a physical machine for each application builds a logical or virtual machine. ...