QBasic Programming

WAP to enter any ten strings and display the shortest string

CLS
INPUT "ENTER FIRST STRING"; A$
FOR I = 2 TO 10
INPUT "ENTER NEXT STRING"; B$
IF LEN(B$) < LEN(A$) THEN A$ = B$
NEXT I
PRINT "SHORTEST STRING="; A$
END
USING SUB PROCEDURE
DECLARE SUB SHRT( A$ )
CLS
INPUT "ENTER FIRST STRING"; A$
CALL SHRT (A$)
END
SUB SHRT (A$)
FOR I = 2 TO 10
INPUT "ENTER NEXT STRING"; B$
IF LEN(B$) < LEN(A$) THEN A$ = B$
NEXT I
PRINT "SHORTEST STRING="; A$
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION SHRT$( A$ )
CLS
INPUT "ENTER FIRST STRING"; A$
PRINT "SHORTEST STRING=";  SHRT$(A$)
END
FUNCTION SHRT$(A$)
FOR I = 2 TO 10
INPUT "ENTER NEXT STRING"; B$
IF LEN(B$) < LEN(A$) THEN A$ = B$
NEXT I
SHRT$ = A$
END FUNCTION

WAP to enter any ten strings and display the longest strings (Prev Lesson)
(Next Lesson) WAP to enter any ten strings and sort in ascending order
Back to QBasic Programming
Notice: compact(): Undefined variable: limits in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

Notice: compact(): Undefined variable: groupby in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!