Programming (Part 4)
1. WAP to modify division identification program using SELECT CASE.
=> CLS
INPUT "Enter secured percentage"; P
SELECT CASE P
CASE IS >= 60
PRINT "First Division"
CASE 50 TO 59.9
PRINT "Second Division"
CASE 40 TO 49.9
PRINT "Third Division"
CASE ELSE
PRINT "Failed"
END SELECT
END
2. WAP to check whether the number is positive or negative or zero.
=> CLS
INPUT "Enter any number"'; A
SELECT CASE A
CASE IS > 0
PRINT "Number is positive"
CASE IS< 0
PRINT "Number is zero"
CASE ELSE
END SELECT
END
3. WAP to find area of circle asking the user to continue or not.
=>TOP:
CLS
INPUT "Enter radius" ; R
A = 22/7 * R ^ 2
PRINT "Area = "; A
INPUT "Do you want to continue? "; I$
IF UCASE$ (I$) = "Y" THEN GOTO TOP
END
4. WAP to find sum of two numbers and ask whether to continue or not.
=>TOP:
CLS
INPUT "Enter two numbers"; A, B
S = A + B
PRINT "Sum = "; S
INPUT "Do you want to continue? "; I$
IF UCASE$ (I$) = "Y" THEN GOTO TOP
END
5. WAP to display natural numbers from 1 to 100.
=> CLS
FOR I = 1 TO 100
PRINT I
NEXT I
END
6. WAP to display even numbers from 2 to 100.
=> CLS
FOR I = 2 TO 100 STEP 2
PRINT I
NEXT I
END
7. WAP to display all even numbers from 50 to 10.
=> CLS
FOR I = 50 TO 10 STEP -2
PRINT I
NEXT I
END
8. WAP to display 3,6,9 upto 10 times.
=> CLS
A= 3
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
9. WAP to display 50,47,44 upto 10 times.
=> CLS
A= 50
FOR I = 1 TO 10
PRINT A
A = A - 3
NEXT I
END
10. WAP to display 1,4,9 upto 10 times.
=> CLS
FOR I = 1 TO 10
PRINT I ^ 2
NEXT I
END
11. WAP to display 1,7,13,19 upto 10 times.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 6
NEXT I
END
12. WAP to display 1,1,2,3 upto 10 times.
=> CLS
A = 1
B = 1
FOR I = 1 TO 5
PRINT A
PRINT B
A = A + B
B = A + B
NEXT I
END
13. WAP to display 1,4,7 upto 10 terms.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
14. WAP to display first 10 multiples of 7.
=> CLS
A= 7
FOR I = 1 TO 10
PRINT A * I
NEXT I
END
15. WAP to display square root of numbers from 100 to 80.
=> CLS
FOR I = 100 TO 80 STEP -1
PRINT I ^ (1/2)
NEXT I
END
16. WAP to display cubes of numbers from 2 to 15.
=> CLS
FOR I = 2 TO 15
PRINT I ^ 3
NEXT I
END
17.WAP to display 1,4,7 upto 10 terms.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
18. WAP to display first 10 multiples of 7.
=> CLS
A= 7
FOR I = 1 TO 10
PRINT A * I
NEXT I
END
19. WAP to display square root of numbers from 100 to 80.
=> CLS
FOR I = 100 TO 80 STEP -1
PRINT I ^ (1/2)
NEXT I
END
20. WAP to display multiplication table of entered number.
=> CLS
INPUT "You want to see multiplication table of ?"; A
FOR I = 1 TO 10
PRINT A * I
NEXT I
END
21. WAP to display your name 10 times.
=> CLS
INPUT "Enter your name"; N$
FOR I = 1 TO 10
PRINT N$
NEXT I
END
22. WAP to print 5,10,15 upto 10 times.
=> CLS
A= 5
FOR I = 1 TO 10
PRINT A
A = A + 5
NEXT I
END
23. WAP to print 1,4,7 upto 10 times.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
24. WAP to print 3,6,9 upto 10 times.
=> CLS
A= 3
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
25. WAP to print 50,47,44 upto 10 times.
=> CLS
A= 50
FOR I = 1 TO 10
PRINT A
A = A - 3
NEXT I
END
26. WAP to print 1,7, 13 upto 10 times.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 6
NEXT I
END
27. WAP to display 1,1,2,3 upto 10 times.
=> CLS
A = 1
B = 1
FOR I = 1 TO 5
PRINT A
PRINT B
A = A + B
B = A + B
NEXT I
END
28. WAP to display even numbers from 50 to 10 and find sum.
=> CLS
S= 0
FOR I = 50 TO 10 STEP -2
PRINT I
S = S + I
NEXT I
PRINT "SUM = "; S
END
29. WAP to print all numbers from 1 to 10 and find sum.
=> CLS
S= 0
FOR I = 1 TO 10
PRINT I
S = S + I
NEXT I
PRINT "SUM = "; S
END
30. WAP to print all numbers from 99 to 1 with sum.
=> CLS
S= 0
FOR I = 99 TO 1 STEP -1
PRINT I
S = S + I
NEXT I
PRINT "SUM = "; S
END
=> CLS
INPUT "Enter secured percentage"; P
SELECT CASE P
CASE IS >= 60
PRINT "First Division"
CASE 50 TO 59.9
PRINT "Second Division"
CASE 40 TO 49.9
PRINT "Third Division"
CASE ELSE
PRINT "Failed"
END SELECT
END
2. WAP to check whether the number is positive or negative or zero.
=> CLS
INPUT "Enter any number"'; A
SELECT CASE A
CASE IS > 0
PRINT "Number is positive"
CASE IS< 0
PRINT "Number is zero"
CASE ELSE
END SELECT
END
3. WAP to find area of circle asking the user to continue or not.
=>TOP:
CLS
INPUT "Enter radius" ; R
A = 22/7 * R ^ 2
PRINT "Area = "; A
INPUT "Do you want to continue? "; I$
IF UCASE$ (I$) = "Y" THEN GOTO TOP
END
4. WAP to find sum of two numbers and ask whether to continue or not.
=>TOP:
CLS
INPUT "Enter two numbers"; A, B
S = A + B
PRINT "Sum = "; S
INPUT "Do you want to continue? "; I$
IF UCASE$ (I$) = "Y" THEN GOTO TOP
END
5. WAP to display natural numbers from 1 to 100.
=> CLS
FOR I = 1 TO 100
PRINT I
NEXT I
END
6. WAP to display even numbers from 2 to 100.
=> CLS
FOR I = 2 TO 100 STEP 2
PRINT I
NEXT I
END
7. WAP to display all even numbers from 50 to 10.
=> CLS
FOR I = 50 TO 10 STEP -2
PRINT I
NEXT I
END
8. WAP to display 3,6,9 upto 10 times.
=> CLS
A= 3
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
9. WAP to display 50,47,44 upto 10 times.
=> CLS
A= 50
FOR I = 1 TO 10
PRINT A
A = A - 3
NEXT I
END
10. WAP to display 1,4,9 upto 10 times.
=> CLS
FOR I = 1 TO 10
PRINT I ^ 2
NEXT I
END
11. WAP to display 1,7,13,19 upto 10 times.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 6
NEXT I
END
12. WAP to display 1,1,2,3 upto 10 times.
=> CLS
A = 1
B = 1
FOR I = 1 TO 5
PRINT A
PRINT B
A = A + B
B = A + B
NEXT I
END
13. WAP to display 1,4,7 upto 10 terms.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
14. WAP to display first 10 multiples of 7.
=> CLS
A= 7
FOR I = 1 TO 10
PRINT A * I
NEXT I
END
15. WAP to display square root of numbers from 100 to 80.
=> CLS
FOR I = 100 TO 80 STEP -1
PRINT I ^ (1/2)
NEXT I
END
16. WAP to display cubes of numbers from 2 to 15.
=> CLS
FOR I = 2 TO 15
PRINT I ^ 3
NEXT I
END
17.WAP to display 1,4,7 upto 10 terms.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
18. WAP to display first 10 multiples of 7.
=> CLS
A= 7
FOR I = 1 TO 10
PRINT A * I
NEXT I
END
19. WAP to display square root of numbers from 100 to 80.
=> CLS
FOR I = 100 TO 80 STEP -1
PRINT I ^ (1/2)
NEXT I
END
20. WAP to display multiplication table of entered number.
=> CLS
INPUT "You want to see multiplication table of ?"; A
FOR I = 1 TO 10
PRINT A * I
NEXT I
END
21. WAP to display your name 10 times.
=> CLS
INPUT "Enter your name"; N$
FOR I = 1 TO 10
PRINT N$
NEXT I
END
22. WAP to print 5,10,15 upto 10 times.
=> CLS
A= 5
FOR I = 1 TO 10
PRINT A
A = A + 5
NEXT I
END
23. WAP to print 1,4,7 upto 10 times.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
24. WAP to print 3,6,9 upto 10 times.
=> CLS
A= 3
FOR I = 1 TO 10
PRINT A
A = A + 3
NEXT I
END
25. WAP to print 50,47,44 upto 10 times.
=> CLS
A= 50
FOR I = 1 TO 10
PRINT A
A = A - 3
NEXT I
END
26. WAP to print 1,7, 13 upto 10 times.
=> CLS
A= 1
FOR I = 1 TO 10
PRINT A
A = A + 6
NEXT I
END
27. WAP to display 1,1,2,3 upto 10 times.
=> CLS
A = 1
B = 1
FOR I = 1 TO 5
PRINT A
PRINT B
A = A + B
B = A + B
NEXT I
END
28. WAP to display even numbers from 50 to 10 and find sum.
=> CLS
S= 0
FOR I = 50 TO 10 STEP -2
PRINT I
S = S + I
NEXT I
PRINT "SUM = "; S
END
29. WAP to print all numbers from 1 to 10 and find sum.
=> CLS
S= 0
FOR I = 1 TO 10
PRINT I
S = S + I
NEXT I
PRINT "SUM = "; S
END
30. WAP to print all numbers from 99 to 1 with sum.
=> CLS
S= 0
FOR I = 99 TO 1 STEP -1
PRINT I
S = S + I
NEXT I
PRINT "SUM = "; S
END
Comments
Post a Comment