Posts

Showing posts from October, 2019

25. WAP to display

1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 CLS A = 5 FOR I = 1 TO 10 PRINT A A = A + 5 NEXT I END

24. Wap to display

1 1 2 1 2 3 1 2 3 4 5 1 2 3 4 5 CLS FOR I = 1 TO 5 FOR J = 1 TO I PRINT J; NEXT J PRINT NEXT I END

23. 5,10,15,20 ... 10 term

CLS A = 5 FOR I = 1 TO 10 PRINT A A = A + 5 NEXT I END

22. 1,4,9,16... term

CLS FOR I = 1 TO 10 PRINT I ^ 2 NEXT I END

21. 1,1,2,3,5,8 up to 10 term

CLS A = 1 B = 1 FOR I = 1 TO 10 C = A + B A= B B = C NEXT I END

20. Multiplication table

CLS INPUT ''Enter any number''; N FOR I = 1 TO 10 PTINT N ; ''X'' ; I ; ''='' ; N * I NEXT I END

19. Display factorial

CLS INPUT ''Enter any number''; N F = 1 FOR I = 1 TO N F = F * I NEXT I PRINT ''Factorial number''; F END

18. Display factor

CLS INPUT ''Enter any number''; N FOR I = 1 TO N IF N MOD I = O THEN PRINT I NEXT I END

17. Display prime or composite

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 ''The given no is composite'' ELSE PRINT ''The given no is prime'' END IF END

16. Armstrong

CLS INPUT ''Enter any number''; N A = N S = 0 WHILE N < > 0 R = N MOD 10 S = S + R ^ 3 N = N / 10 WEND IF A = S THEN PRINT ''The given number is armstrong'' ELSE PRINT ''The given number is not armstrong'' END IF END

15. Palindrome

CLS INPUT ''Enter any number''; N A = N S = 0 WHILE N < > 0 R = N MOD 10 S = S + 10 * R N = N / 10 WEND IF A = S THEN PRINT ''The given number is palindrome'' ELSE PRINT ''The given number is not palindrome'' END IF END

14. Display reverse 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 digit''; S END

13. Display 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 digit''; P END

12. Display sum of digit

CLS INPUT ''Enter any number''; N S = 0 WHILE < > 0 R = N MOD 10 S = S + R N = N / 10 WEND PRINT ''Sum of digit''; S END

11. Display greatest among three number

CLS INPUT ''Enter any number''; N IF A>B and B>C THEN PRINT ''The greatest number is''; A ELSE IF B>A and B>C THEN PRINT ''The greatest number is''; B ELSE PRINT ''The greatest number is''; C END IF END

10. Odd or even

CLS INPUT ''Enter any number''; N IF N MOD 2 = 0 THEN PRINT ''The number is odd'' ELSE PRINT ''The given number is even'' END IF END

9. positive, negative or zero

CLS INPUT ''Enter any number''; N IF N = 0 THEN PRINT ''Given number is positive''; ELSE IF N<0 THEN PRINT ''Given number is negative'' ELSE PRINT ''Given number is zero'' END IF END

8. Volume of cylinder

CLS INPUT ''Enter radius''; R INPUT ''Enter height''; H V = 22/7*R^2*H PRINT ''Volume of cylinder''; V END

7. Volume of cube

CLS INPUT ''Enter length''; L V = L^3 PRINT ''Volume of cube''; V END

6. Volume of box

CLS INPUT ''Enter length''; L INPUT ''Enter breadth''; B INPUT ''Enter height''; H V = L*B*H PRINT ''Volume of box''; V END

5. Area of 4 walls

CLS INPUT ''Enter length''; L INPUT ''Enter breadth''; B INPUT ''Enter height''; H A = 2*H*L+B PRINT ''Area of 4 walls''; A END

4. Area of square

CLS INPUT ''Enter length''; L A = L 2 PRINT ''Area of square=''; A END

3. Area of triangle

CLS INPUT ''Enter base''; b A = 1/2*b*h PRINT ''Area of triangle''; A END

2. Area of circle

CLS INPUT ''Enter radius''; r A = 22/7*r  2 PRINT ''Area of circle''; A END

1. Area of rectangle

CLS INPUT ''Enter length''; L INPUT ''Enter breadth''; B A = L * 5 PRINT '' Area of rectangle''; A END