Comment

haha
haha,
April 17, 2009 at 11:06 AM

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
int array[] = { 90, 3, 33, 28, 80, 49, 8, 30, 36, 25 };
int sort(const void *x, const void *y) {
return (*(int*)x - *(int*)y);
}
void main() {
clrscr();
int i;
qsort(array, 10, sizeof(int), sort);
for (i=0; i<10; i++) {
printf("%d ", array[i]);
}
getch();
}
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
C++

C Tutorials
C array sort example For sorting an array, we have used... algorithm to sort the elements of an array .   C String... C Tutorials       

Blog

Site map - C Tutorials
sort example | C array of pointers | C Array length example | C Array...; C Tutorials  | Java Tutorials | PHP Tutorials  | Linux...; | XPath Tutorials | HTML Tutorials C Tutorial Section C String Reverse 

Design concepts & design patterns Questions

C++
C++  Trace the bubble sort using the following integers,which represent the elements in an array. 5,7,3,8,6,7,3 

Programming Tutorials

C++Tutorials
other tutorials, such as C++: Annotations by Frank Brokken and Karel Kubat...; The CPlusPlus Language Tutorial These tutorials explain the C++ language... as reference. U will need a C++ compiler of some sort, if you are using 

Java Beginners

C++
C++  Describe the principle advantages of deploying a linked list versus a static array when implementing a Queue or a Stack 

C Tutorials

C array sort example
C array sort example       In this section, you will learn how to sort an array in C. For sorting... the implementation of quicksort algorithm to sort the elements of an array. Syntax 

CVS Questions

c++
c++  Write a console based C++ program that reads student information from a text file, build an array of objects of type class StudentInfo... name with the minimum GPA 7) Display Student GPAs as Letter Grades (A, B, C, D 

IoC Questions

Array in C
Array in C  Respected Sir, How can an array be an lvalue, if we can't assign to it? How can I set an array's size at run time? How can I avoid fixed-sized arrays? help me sir 

Java Beginners

C/C++ QUESTIONS
C/C++ QUESTIONS  ??Write a function for finding out the occurences of repeated word from a sentence. This function would return an array of duplicate words. 

Framework Questions

c postfix - Framework
://www.roseindia.net/c-tutorials/index.shtml Thanks...c postfix  q: write a c program to read apostfix expression store it in array of character then evaluate this expression using eval and get_token 

Java Beginners

C/C++ QUESTIONS
C/C++ QUESTIONS  "Write a function for finding out highest and lowest marks obtained by a student from an array contained student name and marks". For Example : GetHighestLowestMarks{Student{n}, Marks{n}} returns 

Mobile Applications Questions

Array Initialization in obj C
Array Initialization in obj C  how can we initialize array in objective with some object ??? and give me also way to print the Array!!!   hello, you can initialize the array by this code // in your .h @interface 

General

C Tutorials
C       Java... instances are comparable, we can sort them in any order. Comparable interface is defined in java.lang package and is used to define the natural sort 

Java Interview Questions

How to create dynamic array in C?
How to create dynamic array in C?  How to create dynamic array in c programming language?   Dynamic Array in C Tutorial 

Ajax Questions

c#
c#  how to find out the size of the BMP image in C 

CVS Questions

C++
C++  How can i write this in dev c 

Development process Questions

C++
C++  How can i write this in dev c 

Development process Questions

c++
c++  use a prgrm as an example to xplain-: a)class b)object c)message d)cope resolution operator 

Ajax Questions

c#
c#  how to find out the size of the BMP image 

Development process Questions

c++
c++  write a programme that calculates the area and circumference of a rectangle 

Development process Questions

C++
C++  dear sir How to create windows form application for login screen using C++? USER Name -TESTADMIN Password -testuser 

Java Beginners

c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used 

Java Beginners

c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used 

Java Beginners

c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used 

Development process Questions

C++
C++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples 

Development process Questions

c++
c++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples 

Development process Questions

c++
c++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples 

Development process Questions

c++
c++  write a prgrm tht accepts 3 integer values,then with a function to swap the values 

Java Beginners

C/C++/JAVA Question on function
C/C++/JAVA Question on function  "Write a function to find out common alphabets between two arrays. Length of array is not fixed and may contain other data type also.â?? Question can be solved in C,C++ or JAVA 

Java Beginners

C#
C#  i need a code that will make program perform the basic operations upon the data Listview save, update and cancel 

Development process Questions

C++
C++  I have been asked to write a programme that gets five values,gets the sum,average and product please help me 

Development process Questions

C#
C# register form  i want to generate a user id automatically after filling their register form and i want to show their id to their email? please reply me soon 

UML Questions

c++
c++  Consider the following function: int funcExercise7(int list[], int size) { int sum = 0; for (int index = 0; index < size; index++) sum = sum + list[index]; return sum 

UML Questions

c++
c++  Consider the following declarations: class xClass { public: void... private members does class xClass have? c. How many constructors does class xClass.... Write a C++ statement that prints the values of the data members of the object 

Development process Questions

c++
c++  .write a program that accepts 5 subjects of a student,it should have a function to calculate the average & another function to grade.grade should be as follows-<40=E,40-49=D,50-59=C,60-69=B & >70 

Development process Questions

C++
C++  write a prgrm tht gets five values,gets the sum,average &...; #include <conio.h> void main() { clrscr(); int a,b,c,d,e,sum; float average...;>b>>c>>d>>e; sum=a+b+c+d+e; average=sum/5; product=a*b*c*d 

Development process Questions

c++
c++  write a prgrm tht calculates the surface area of a cylinder.the prgrm shld find the circumfrance and have a function that calculates the fadius and another to calculate the surface area 

Spring Framework Questions

c++
c++  write a program that gets a key or character from the keyboard and displays it ASII code in decimal, hexadecimal and binary form.It must also give a description of the key pressed 

UML Questions

c++
c++  Consider the following declarations: class xClass { public: void func(); void print() const; xClass (); xClass (int, double); private: int u... private members does class xClass have? c. How many constructors does class xClass 

UML Questions

c++
c++  Characterize the following algorithm in terms of Big-O notation. Also find the exact number of additions executed by the loop. (Assume that all variables are properly declared.) for (int i = 1; i <= n; i++) sum = sum + i 

UML Questions

c++
c++  Characterize the following algorithm in terms of Big-O notation. for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) for (int k = 1; k <= n; k++) cout << i + j + k 

UML Questions

C++
C++  . Consider the definition of the following class: class CC { public: CC(); //Line 1 CC(int); //Line 2 CC(int, int); //Line 3 CC(double, int); //Line 4 . . . private: int u; double v 

Development process Questions

c++
c++  .write a prgrm tht accepts 5 subjects of a student,it shld hv a function to calculate the average & another function to grade.grade shld be as follows-<40=E,40-49=D,50-59=C,60-69=B & >70 

UML Questions

c++
c++  Write the definition of the class dayType that implements the day of the week in a program. The class dayType should store the day... on an object of type dayType: a. Set the day. b. Print the day. c. Return the day 

Development process Questions

c++
c++  write a programme that calculates the area and circumference of a rectangle   #include<conio.h> #include<iostream.h> class rect { int l,b; int area; int peri; public: void get_rect() { cout<<"\n 

Java Beginners

c++
c++   Assume vector "x" of integers with values of 7, 3, 5, 8, 1, 9, 0, 4, 2, 6. Second, assume integer variables "a," "b" and "y" with values of 3, x.size()-5 and 0, respectively. Third, assume a for-loop header which: 3.1 

Free C# books

C and C++ books
; Page 4 An array in C is a region of memory in which the elements can...-fashioned C string) and in the second case a zero-terminated array of XMLCh's... In this section for example-based C tutorials that introduce you to ODBC 

Java Tips and Examples

Insertion Sort In Java
: C:\array\sorting>javac InsertionSort.java C:\array\sorting>java InsertionSort... 3 4 9 10 12 99 120 PAUSE C:\array\sorting> 

Java Tips and Examples

Selection Sort In Java
same steps. Working of the selection sort :Say we have an array...: C:\array\sorting>javac selectionSort.java C:\array\sorting>java selectionSort RoseIndia 

Programming Tutorials

C++GraphicsTutorials
C++ Graphics Tutorials     ... in this document is correct. C/C++ Windows programmers who want to learn... MFC.      OpenIL in Dev-C++ OpenIL 

General

Heap Sort in Java
\sorting>Javac heap_Sort.java C:\array\sorting>java heap_Sort Heap Sort...Heap Sort in Java is used to sort integer values of an array. Like quicksort... are replaced into array. Steps in heap sort: The Root node is replaced 

Java Tips and Examples

Merge Sort In Java
Values after the sort: 1 3 4 9 10 12 99 120 PAUSE C:\array... are followed by merge sort algorithm to sort the values of an array. Step1:Spliting.... Steps of Merge Sort: Say unsorted  an array values 

Java Tips and Examples

Quick Sort In Java
is developed by C. A. R. Hoare. Quick sort is a comparison sort. The working...: In quick sort algorithm pick an element from array...: C:\array\sorting>javac QuickSort.java C:\array\sorting> 

Java Beginners

programming c#
programming c#   create and make use of at least one class with appropriate instance methods to solve the programming problem. use console-based... in arrays (where appropriate). at least one two-dimention array should be used 

IDE Questions

c programme
c programme  When we drop a ball on a rigid surface it bounces from... a program in C that where the user will input an initial height(in metres) and also...). Declare an array HEIGHT[101] for storing the height of the ball after each bounce 

Tutorials

NSString in objective c
NSString in objective c In this series of Iphone application development tutorials, we going to introduce you with some of the iphone basic classes and objects...that are used in objective C. NSString is one of them. Brief Introduction 

Java Tips and Examples

Selection Sort in Java
Selection sort in Java is used to sort the unsorted values in an array...]; array[index_of_min] = temp; } } } Output: C:\array\sorting>javac selectionSort.java C:\array\sorting>java selectionSort RoseIndia Selection 

Java Tips and Examples

Merge Sort Java
Merge Sort in Java is used to sort integer values of an array. There are many methods to sort Java like bubble sort, insertion sort, selection sort, etc...:\array\sorting>javac mergeSort.java C:\array\sorting>java mergeSort 

Development process Questions

C,C++
C,C++  Sir, 100&30 gives output 4 in C++ and 100|30 gives output 116 How & and | gives output 4 and 116 

Java Tips and Examples

Quick Sort in Java
QuickSort.java C:\array\sorting>java QuickSort RoseIndia Quick Sort...Quick sort in Java is used to sort integer values of an array... into a sorted array. Example of Quick Sort in Java: public class QuickSort 

Programming Tutorials

Merge of two arrays in C
;The elements of second array are : \n"); display(b,5); sort(a,5...(a,5); sort(b,5); printf("The sorted second array in decending order... read(int *,int); void display(int *,int); void sort(int *,int); void 

Development process Questions

C,C++
C,C++  int i=100,j=20; int c=i&j; int r=i|j; printf("%d",c); printf("%d",r);   #include<stdio.h> #include<conio.h> void main(){ int i=100,j=20; int c=i&j; int r=i|j; printf("%d",c); printf("%d",r 

General

Heap Sort in Java
: C:\array\sorting>Javac heap_Sort.java C:\array\sorting>java heap_Sort Heap Sort... minimum root than his child. We can sort the array values using heap sorting 

Java Tips and Examples

Bidirectional Bubble Sort in Java
-directional bubble sort algorithm to sort the values of an array.  ...: C:\array\sorting>javac BidirectionalBubbleSort.java C... 120 PAUSE C:\array\sorting> 

Free C books

C and C++ books-page8
C and C++ books-page8       The ODBC from C Tutorial  In this section for example-based C tutorials that introduce you to ODBC API programming in C. Each tutorial contains 

Development process Questions

all c library functions
all c library functions  hi dear c coders, i need all c library functions with a detailed explanation. Who can give me usefull link? thanks beforehand!   Hi Friend, Please go through the following link: C Tutorials 

SQL Question

C program - SQL
C program  Thank You . Write some C programs using pointers . Write some C programs using files. Please reply me .   Hi Friend, Please visit the following link: http://www.roseindia.net/c 

Java-Tutorials

Java Multi Dimensions Array - Java Tutorials
is done using array.An array can hold any type of data and can have multidimensional. For accessing elements of array we use its index. In other words, we can say that array is the set of same type of data stored under the same roof. Given 

Java Interview Questions

about c and java
://www.roseindia.net/c-tutorials/ http://www.roseindia.net/interviewquestions...about c and java   i need java and c language interview and objective questions with answers for the fresher.please provide to me   Please 

Mobile Applications Questions

Select string from array in objective c
Select string from array in objective c  Hi, I wanted to select a string from the database table in objective c. But somehow it is not working..can-you suggest anything regarding the fetch query in objective c? Thanks.   

Java Tips and Examples

Odd Even Transposition Sort In Java
: C:\array\sorting>javac OddEvenTranspositionSort.java C:\array\sorting>java... C:\array\sorting> 

Programming Tutorials

Array Implementation in C
Array Implementation in C Code: #include<stdio.h> #include<conio.h... for an array \n"); read(size,5); printf("All elements of the array are : \n"); display(size,5); } void read(int c[],int i) { int j 

Java Beginners

Array sort
Array sort  Program that uses a function to sort an array of integers 

C Tutorials

C Array Declaration
C Array Declaration       In this section, you will learn how to declare an array in C. To declare an array in C, you have to specify the name of the data type and the number 

iPhone

Objective C Array
Objective C Array In a simple term we can say that array is a object, which is a collection of number of other objects. In Objective C, we can also add.... Syntax to declare an Array in Objective C: NSArray *myArray 

Java Tips and Examples

Extra Storage Merge Sort in Java
into an array .Then again merge the next part , sort it and store into an array. Do... sort the sorted values are stored in an other array. Working of extra storage merge sort algorithm: Say we have an array unsorted  

Java Beginners

sorting Line in c
sorting Line in c  Hi I need help with sorting line in programming c asking user to enter 1-10 characters and then sort them in lower case, alphabetical and ascending order. Any help will be appreciated! please help! void 

Free C# books

C and C++ books-page4
An array in C is a region of memory in which the elements (chars, ints, etc.) can be accessed using an index (in a 1-dimensional array, e.g. name[0]) or several... C and C++ books-page4       

Java Beginners

c++ - Java Beginners
c++  to write a program to display the elements in different format using single dimensional array with the help of function templates algorithm: 1.start the program 2.create a class elements 3.delete single 

Programming Tutorials

Inverse of an array in C
(a,6); getch(); } void read(int c[],int i) { int j; printf("Enter six element for an array \n"); for(j=0;j<i;j++) scanf("%d",&c[j]); } void display(int d[],int i) { int j; printf 

Development process Questions

c/c++ - Development process
c/c++  Creating animation using c/c++. The code for moving an object using c/c 

CVS Questions

a little pproblem in c++
a little pproblem in c++  i have one array where are only ,,0'' and ,,10'' like this n=11 <0 0 10 0 0 10 0 0 10 10 10> n=11 <10... 0 0> and a want create other array n=11 <1 1 2 3 3 4 5 5 6 7 8> n 

IoC Questions

iphone sdk-objective c
iphone sdk-objective c  how to delete random value which is got from the random function in an array 

Free Books

C and C++ books-page6
a char * (an old-fashioned C string) and in the second case a zero-terminated array... C and C++ books-page6       The Refactoring C++ Code  The two functions DOMString.transcode 

Java Beginners

C Program....PLEASE HELP
C Program....PLEASE HELP  For this assignment, you are to write a program that calculates points along a rhodonea curve, a.k.a. a mathematical rose... in the theta array. Returns the number of values successfully filled, which 

Development process Questions

c/c++ - Development process
c/c++  I need the code for developping two dice and roll them using c/c++. Thanks 

Java Beginners

variable declaration in c and c++
variable declaration in c and c++  Comparison and an example of variable declaration in C and C 

Development process Questions

concatenation of Two bytes in C
concatenation of Two bytes in C  Hi, I need to concatenate two bytes array in C.How to do that. bytes[0] = (n >> 24) & 0xFF; bytes[1] = (n...; 0xFF; I need concatenate these to single byte array 

Development process Questions

C/C++ - Development process
C/C++  I need the code for playing the backgammon game using C/C++.Im using turbo C. I`ve already design the board.I badly need the code for playing this game 

General

C Tutorials
 

Java Beginners

basic c/c++ questions
basic c/c++ questions  Are the Control statements like if(),while() in built functions? if no, why not as they satisfy all the properties of a function 

Java Beginners

basic c/c++ questions
basic c/c++ questions  Are the Control statements like if(),while() in built functions? if no, why not as they satisfy all the properties of a function 

General

Generic toString - Java Tutorials
you sort out the huge number of classes that you get when you use a lot..., without the package. */ public static String stripPackageName(Class c... is an array. We would like to be able to deal with multi-dimensional arrays 

Java Tips and Examples

Java vs. C
Java: Java vs. C Is Java easier or harder than C? Java is harder because ... Java is more powerful and can do much more than C. For example, C doesn't have a graphical user interface (GUI), and C doesn't have any 

Development process Questions

c/c++ - Development process
c/c++  Ive been asked to develop a backgammon game using C language. I don't know which code to use to move checkers and to roll die. I would appreciate to get some help. Thanks 

Development process Questions

c/c++ - Development process
c/c++  Ive been asked to develop a backgammon game using C language. I don't know which code to use to move checkers and to roll die. I would appreciate to get some help. Thanks 

Java Beginners

c c++ - Java Beginners
c c++  Write a Multi-user chat server and client  Hi Friend, Please visit the following link: http://www.roseindia.net/chatserver/index.shtml Hope that it will be helpful for you. Thanks 

Java Beginners

c or c++ - Java Beginners
c or c++  Write a program for a two user chess game(Users must be on different systems)? please send me this source code to my mail id with step by step explanation 

Free Books

C and C++ books-page12
might want to go through other tutorials, such as C++: Annotations by Frank... C and C++ books-page12       Introduction to C programming  This section is designed 

Development process Questions

C++ Starter needs help :S
C++ Starter needs help :S  Hi, im 15 & im trying to learn how to program, i am starting with C & C++ since these are (what ive been told... questions abaut C++. Please help! :(   Please visit the following link: C 

Advertisements Advertisements
 

 

 

DMCA.com