General discussion

Locked

Qbasic questions

By sweetliar105 ·
I'm a student please, help me with the following :

1) Write a Qbasic program to sort a linear array A containing N number of elements in a ascending order.

2) Write a Qbasic program to carry out multiplication of two matrices.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by tech_wiz03 In reply to Qbasic questions

dim shared sort()

call load_sort(n) ' you supply method for loading array

for i1 = 0 to n-2
for i2 = i1+1 to n-1
if sort(i1)>=sort(i2) then swap sort(i1),sort(i2)
next
next

this is the basic idea behind a bubble sort

regards
rick

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums