# include <stdio.h> void quicksort(int a[],int st,int end); main() { int n,i,b[10],c[10]; printf("Enter the number of elements"); scanf("%d",&n); printf("Enter the elements 1 by 1 \n"); for(i=0;i<n;i++) { scanf("%d",&b[i]); c[i] = b[i]; } quicksort(b,0,n-1); printf("\tQUICK SORT\n"); printf("\t**********\n\n"); printf("\tNumbers \tSorted List\n"); printf("\t******** \t***********\n"); for(i=0;i<n;i++) printf("\t%d\t\t%d\n",c[i],b[i]); } void quicksort(int a[],int st,int end) { int elt,low,high; low = st; high = end; elt = a[st]; while (st < end) { while ((a[end] >= elt) && (st < end)) end--; if (st != end) { a[st] = a[end]; st++; } while ((a[st] <= elt) && (st < end)) st++; if (st != end) { a[end] = a [st]; end--; } } a[st] = elt; elt = st; st = low; end = high; if ( st < elt) quicksort(a,st,elt-1); if (end > elt) quicksort(a,elt+1,end); } Enter the number of elements6 Enter the elements 1 by 1 34 12 9 0 45 123 QUICK SORT ********** Numbers Sorted List ******** *********** 34 0 12 9 9 12 0 34 45 45 123 123
To write a C++ program to display the student details using class and array of object.
If you are using an array : sort using qsort() then take middle element.
write an assembly language program to find sum of N numbers
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....
public static int[] reverseArray(int[] array) { int i = 0, j = array.length - 1; for (i = 0; i < array.length / 2; i++, j--) { int temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; }
A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.
system.exit o
Use the Array Package. if you need help - add me on msn james_mc_123@hot dkjdkdjd mail.comp
// Assuming you dynamically allocated this array using "new"... delete array[arraysize - 1]; arraysize--;
the example of array over charcter variables is char ["string"]
for (int i = 0; i < myArray.length(); i++) System.out.println(myArray[i]);