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 arrange the contents of a 1D array in
ascending order

Answer Posted / prakashmca

#include<stdio.h>
#include<conio.h>
void main()
{
int a[20],n,i,j,temp;
clrscr();
printf("\n enter the size of the array");
scanf("%d",&n);
printf("\n enter the contents of the array");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n-1;i++)
{
for(j=0;j<n;j++)
{
if(a[i]>a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
getch();
}

Is This Answer Correct ?    7 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of endless loops?

1032


Where can I get an ansi-compatible lint?

1107


What is register variable in c language?

994


Is it better to bitshift a value than to multiply by 2?

1059


What are the standard predefined macros?

1083


what are the different storage classes in c?

1131


What are the main characteristics of c language describe the structure of ac program?

1158


How are 16- and 32-bit numbers stored?

1250


What is echo in c programming?

972


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

1167


What is realloc in c?

1030


What are the 5 types of organizational structures?

1032


How does normalization of huge pointer works?

1110


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1119


What is a function in c?

1500