Posts

Showing posts from 2017

PROJECT 'B'

Programming Concept QBASIC: 1.        Input any string and reverse it. CLS INPUT "ENTER ANY STRING"; A$ FOR I = LEN(A$) TO 1 STEP -1 B$ = MID$(A$, I, 1) C$ = C$ + B$ NEXT I PRINT "REVERSED STRING IS "; C$ END 2.        Input any string and check whether the given string is palindrome or not. CLS INPUT "ENTER ANY STRING"; A$ FOR I = LEN(A$) TO 1 STEP -1 B$ = MID$(A$, I, 1) C$ = C$ + B$ NEXT I IF A$ = C$ THEN PRINT  A$; “IS PALINDROME” ELSE PRINT A$; “IS NOT PALINDROME” END IF END 3.        Count total no. of vowels in a given string . CLS INPUT "ENTER ANY STRING"; A$ VC = 0 FOR I = 1 TO LEN(A$) B$ = MID$(A$, I, 1) C$ = UCASE$(B$) IF C$ = "A" OR C$ = "E" OR C$ = "I" OR C$ = "O" OR C$ = "U" THEN VC = VC + 1 END IF NEXT I PRINT "TOTAL NO. OF VOWELS= "; VC END 4.        Count total no. of consonants