Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program to sort the elements in a given array in c
language

Answer Posted / yoyo

#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i,j=0;
printf("enter 5 values into the array a");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
printf("the sorted order of elements");
for(i=0;i<5;i++)
{ t=a[i];
for(j=0;j<5;j++)
{
if(a[i]>a[j])
a[i]=t;
a[i]=a[j];
a[j]=t;
}
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to print data of 5 five students with structures?

2042


Write a C program to count the number of email on text

1908


What is the difference between ā€˜g’ and ā€œgā€ in C?

3991


Tell me with an example the self-referential structure?

1007


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1710


What is quick sort in c?

1081


how do you execute a c program in unix.

1109


What is the function of this pointer?

1324


which is an algorithm for sorting in a growing Lexicographic order

1798


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

2574


how to count no of words,characters,lines in a paragraph.

4421


In a switch statement, what will happen if a break statement is omitted?

1058


Explain what is the difference between text files and binary files?

1150


How many levels of pointers can you have?

1188


How is a structure member accessed?

1124