Posts

Display 5,10,15,20....... 10th term CLS A = S For I = 1 To 10 PRINT  A A = A + 5 Next I END
Display 1,4,9,16....... 10th term CLS FOR I  = 1 To 10 PRINT  I ^ 2 NEXT I END
Display 1,1,2,3,5,8.........up to 10th term CLS A = 1 B = 1  FOR I = 1 TO 10 PRINT  A C = A + B A = B B = C NEXT I END
WAP to display the multiplication table of given number. CLS INPUT " Enter any number " ; N FOR I = 1 TO 10 PRINT N ; " X " ; I ; " = " ; N * I NEXT  I END
WAP  to display the factorial of the number CLS INPUT  " Enter any number " ; N F = 1 FOR I = 1 TO N F = F * I NEXT I PRINT " Factorial = " ; F END
WAP the given number is factors. CLS INPUT " Enter any number " ; N FOR = 1 TO N IF N MOD I = 0 THEN  PRINT I NEXT I END
WAP  the given  number 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 number is prime " ELSE PRINT " The given number is composite " END IF END