It is the code in .vbs which allows you to print falling series of random numbers as shown above.

1.Open notepad.exe.
2.Type the following code in the notepad.

echo off
color 02
:MAT
echo  %random%%random%%random%%random%%random%%random%%random%%random%
%random%%random%%random%%random%%random%%random%%random%%random%
goto MAT
3.Save above file as .vbs.
4.Open the vbs file and you will get the desired output.



ALGORITHM : ENQUE(VALUE,QUEUE,FRONT,REAR)
Here REAR is position for input of data into queue,FRONT is position for deletion of data and VALUE is the item to be inserted.This algorithm will insert data into QUEUE. 

1.If REAR=N-1 then : print overflow and return.
2. Set REAR=REAR+1.
3.Set QUEUE[REAR]=VALUE.
4.If FRONT=-1 then :Set FRONT=FRONT+1.
5.Exit


ALGORITHM : DEQUE(QUEUE,FRONT,REAR)
Here REAR is position for input of data into queue,FRONT is position for deletion of data .This algorithm will delete a data from QUEUE. 

1.If FRONT=-1 then : print underflow and return.
2.print QUEUE[FRONT].
3.If FRONT=REAR then :Set FRONT=REAR=-1.
    Else :Set FRONT=FRONT+1.
4.Exit.

ALGORITHM : TRAVERSAL(QUEUE,FRONT,REAR)
Here REAR is position for input of data into queue,FRONT is position for deletion of data .This algorithm will display all the data from QUEUE.

1.If FRONT=-1 then : print queue is empty and return.
2.Set I=FRONT.
3.If I<=REAR then :print QUEUE[I].
4.Set I=I+1.
5.Goto 3.
[End Of Loop.]
6.Exit.

If you have any suggestions regarding this post, please comment below in the comment section.

Followers