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
……………………………………………………………………………….
2) WAP to print the factors of a given number
REM Program to print the factors of a given number
CLS
INPUT “Enter any number”; n
FOR i = 1 TO n
IF n MOD i = 0 THEN PRINT i,
NEXT i
END
…………………………………………………………………………………
3) WAP to print the greater among ten different numbers
REM Program to print greater number among ten different numbers
CLS
INPUT “Enter first number”; g
FOR i = 2 TO 10
INPUT “Enter next number”; a
IF a > g THEN g = a
NEXT
PRINT g; ” is the greatest number”
END
………………………………………………………………………………….
4) WAP to print the greater among three different numbers
REM Program to print greater among three different numbers
CLS
INPUT “Enter first number”; a
INPUT “Enter second number”; b
INPUT “Enter third number”; c
IF a > b AND a > c THEN
PRINT a; ” is greater”
ELSEIF b > a AND b > c THEN
PRINT b; ” is greater”
ELSE
PRINT c; ” is greater”
END IF
END
…………………………………………………………………………….
5) WAP to print the greater among two different numbers
REM Program to print the greater among two different numbers
CLS
INPUT “Enter first number”; a
INPUT “Enter second number”; b
IF a > b THEN
PRINT a; ” is greater”
ELSE
PRINT b; ” is greater”
END IF
END
………………………………………………………………………………..
6) WAP to calculate the cube root of a given number
REM Program to calculate the cube root of a given number
CLS
INPUT “Enter any number”; n c = n ^ (1 / 3)
PRINT “Cube root of “; n; ” is “; s
END
…………………………………………………………………………………..
7) WAP to calculate the square root of a given number
REM Program to calculate the square root of a given number
CLS
INPUT “Enter any number”; n s = SQR(n)
PRINT “Square root of “; n; ” is “; s
END
1)Program to check the given number for palindrome in qbasic using declare sub
DECLARE SUB A (N)
CLS
INPUT “ENTER A NUMBER”; N
CALL