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 / balaji

#include<stdio.h>
#include<conio.h>
main()
{
int temp,i,j,n=10;
int arr[n];
clrscr();
printf("\n\tEnter The Values into array");
for(i=0;i<n;i++){
printf("\n Enter Element no %d: ",i);
scanf("%d",&arr[i]);}
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(arr[j] > arr[j+1]){
temp=arr[j];
arr[j]=arr[j+1];
arr[j]=temp;}
}}
printf("\n-- Sorted Series --");
for(i=0;i<n;i++){
printf("\t %d",arr[i]);}
getch();
}

Is This Answer Correct ?    16 Yes 27 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does 1f stand for?

1083


Write program to remove duplicate in an array?

1023


What is the use of pointers in C?

1021


What is a macro in c preprocessor?

1049


What are actual arguments?

1043


Explain what are multibyte characters?

1109


What are local variables c?

956


What are the features of c language?

1020


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5891


Write a progarm to find the length of string using switch case?

2024


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1052


Explain which function in c can be used to append a string to another string?

1035


Is void a keyword in c?

919


i got 75% in all semester am i eligible for your company

2170


What are the c keywords?

1141