Posted by: Sourav | December 6, 2013

ASCII in QBasic


DIM a AS STRING

DIM strings AS STRING

DIM characters AS STRING

DIM numbers AS STRING

DIM others AS STRING

PRINT CHR$(97)

PRINT ASC(“A”)

INPUT “Enter String”, a

FOR x = 1 TO LEN(a)    

strings = MID$(a, x, 1)    

IF (ASC(strings) > 64 AND ASC(strings) < 91) OR (ASC(strings) > 96 AND ASC(strings) < 123) THEN   

      characters = characters + strings   

  ELSEIF (ASC(strings) > 47 AND ASC(strings) < 58) THEN      

   numbers = numbers + strings

    ELSE         others = others + strings

 

    END IF

 

NEXT x

PRINT characters

PRINT numbers

PRINT others

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: