answersLogoWhite

0


Best Answer

DIM nums(10)

CLS

FOR i = 0 TO 9

nums(i) = (RND * 10) + 1

PRINT nums(i)

NEXT

PRINT : PRINT "Press Enter to sort numbers"

rem pause to look at numbers

DO WHILE INKEY$ = "": LOOP

CLS

FOR loop1 = 0 TO 9

FOR loop2 = loop1 + 1 TO 9

IF nums(loop1) > nums(loop2) THEN SWAP nums(loop1), nums(loop2)

NEXT

NEXT

FOR i = 0 TO 9: PRINT nums(i): NEXT

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a basic program to sort ten numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a standard basic program?

That really depends on what sort of program you are trying to build, what do you want the program to do?


How do write sorting of numbers using microprocessor?

There are several methods available to sort numbers. A simple way to program sorting is the so-called "bubble-sort". This is inefficient for larger lists of numbers; in which case it is more convenient to use one of the faster algorithms, for example, "quick-sort".


Write a java program to sort a list of numbers?

The simplest would be to put the numbers into an int[] (integer array) and pass that to java.util.Arrays.sort(int[]) (a static method), which will sort the array in ascending numerical order. Use a float[] or double[] if you need to sort non-whole numbers. You can also use the Collections.sort(List) method to sort the List directly. Or the Collections.sort(List, Comparator) if you wish to specify your own sorting criteria.


How do you write a program that accepts 50 integer values and sort them in basic programming?

Create an array with 50 elements and input the integers one a time, filling the array. Use an insertion sort on the array for each input except the first. Alternatively, input the values first and then use insertion sort.


Write a program in c to sort the details of 10 students using the structure?

for(i = 0; i < num_students; i ++){ sort(student[i]); } That's what you get when you're that specific!


Why it is necessary to use an object in a program?

Objects allow you to achieve a high level of abstraction as result your program can be used for working with different things. A simple example: you want to write a function which will sort array with integers numbers. It's known that if you want your function to sort numbers with floating point you basically have to rewrite your function again but this time for types double or/and float. Or you can use objects and write a class if you want which will do the same thing but for any type as far as certain set of mathematical operations is applicable for all of them.


Write a program to sort 20 decimal numbers in decreasing order and print the result?

decimal[] a = new decimal[20]; // initialize to some numbers for (int i = 0; i < 20; i++) { a[i] = i; } Array.Sort(a); //sorted in increasing order Array.Reverse(a); // decreasing foreach (decimal d in a) { Console.WriteLine(d); }


Write c program to find median?

If you are using an array : sort using qsort() then take middle element.


What do the numbers 214 mean?

I don't know, but if you write that in a sort of Hindi or gujarati way, You are writing " Ram."


A C program using dynamic memory allocation to sort n names in ascending order?

Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.


Algorithm and flow chart of the program for ascending and descending order of numbers?

Use a looping structure. The first step initialises a loop control variable, n, to zero. You then begin the loop by processing the nth element from the array (the process may be a simple print statement). You then increment n. Finally, you test the value of n; if it is less than 10 you start a new iteration of the loop, otherwise you proceed to the end of the flowchart.


Where do you write a story on your computer?

Most computers nowadays come with some sort of word processing program like Microsoft Word - just open that program and follow the directions to get started!