BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 5th Semester > Visual Programming

Visual Programming Sir Ahsan


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 15-12-2009, 11:07 PM
.BZU.'s Avatar


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Default Program for Sorting the elements of an Array (bubble Sort) VB Code (By Sheraz)

Code:
Module Module1
   
   Sub Main()
   Dim ar As Integer()
   Dim temp As Integer
   Dim my_index As Integer
          ar = New Integer() {15, 8, 1, 6, 34, 7, 5, 342, 4, 9}
          my_index = ar.GetUpperBound(0)
   
   For j = 0 To 8
   
   For i = 0 To my_index - 1     ' 1 is subtrcted to avoid INDEX OUT OF RANGE
  If ar(i) > ar(i + 1) Then
                      temp = ar(i)
                      ar(i) = ar(i + 1)
  ar(i + 1) = temp
   End If
   Next
              my_index = my_index - 1
   
   Next
   
   
   For k = 0 To ar.GetUpperBound(0)
              Console.WriteLine(ar(k))
   
   Next
   
          Console.ReadLine()
   End Sub
   
  End Module
   
   
  

__________________
(¯`v´¯)
`*.¸.*`

¸.*´¸.*´¨) ¸.*´¨)
(¸.*´ (¸.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote
Reply

Tags
array, bubble, code, elements, program, sheraz, sort, sorting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program for Linear Search in an Array VB Code (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:06 PM
Display the Odd Numbers of an Array VB Code (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:03 PM
Display the Even Numbers of an Array VB Code (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:02 PM
Find the Average of all elements in an Array VB Code (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:01 PM
Program to find the Sum of all elements in an Array (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:00 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 04:16 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.