Using Signs in QBASIC

                                                         Using Signs in QBASIC Program


1) Use of ! sign.

CLS

word$ = "Nitya"

PRINT word$

PRINT USING "!"; word$

REM "!" this sign prints only one letter from the word.

END


2) Use of & sign

CLS

num1$ = "World"

PRINT num1$

PRINT USING "&"; num1$

REM "&" this sign prints the full word.

END


3) Use of \\ sign

CLS

num1$ = "Nitya"

PRINT num1$

PRINT USING "\\"; num1$

REM "\\" this sign prints two letters of if we give space between \    \, then it will print the letters given the space of  \\ sign

END


4) Use of Locate

CLS

LOCATE 1, 10: PRINT "N";

END


5) Use of Swap

CLS

a = 24

b = 35

SWAP a, b

PRINT a, b

END


6)  Loop Structure


cls

FOR I = 1 to 10 Step 1

Print "Hello"

Next I

END                                       ( Output = Hello, Hello, Hello ------ 10 times )



7) Two times If Used ( Nested If )


cls

If a = 5 then

If b = 6 then

Print " Success "

END If

END If

END



8) Two times FOR used ( Nested For )


cls

FOR I = 1 to 5 Step 1

FOR J = 1 to 5 Step 1

Print J

Next J

Next I

END



9) WHILE Loop


cls

WHILE a = 0

Print " I am a boy "

WEND

END


also


cls

WHILE a <= 10

Print " I am a Man "

a = a + 1

WEND

END



10) DO WHILE Loop


cls

DO

Print " I am in home "

LOOP WHILE a = 0

END

Comments

Most Popular Post

Detective Suryanarayan : THE END

The Adventure of Surya Narayan (AOS)