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 / naga tirupathi rao

#include<stdio.h>
#include<conio.h>
main()
{
int a[25],i,n,sum=0;
clrscr();
prinf("enter the size of array");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("element%d=",i);
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("ascending orderis:");
for(j=0;j<=sum;j++)
{
for(i=1;i<=n;i++)
{
if(j==a[i])
printf("%d",j);
}
}
getch();
}

Is This Answer Correct ?    22 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

4423


Which are low level languages?

1089


how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?

1977


Why flag is used in c?

1129


What is the difference between arrays and pointers?

1121


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1051


What is far pointer in c?

1305


What is modeling?

1046


Is it possible to initialize a variable at the time it was declared?

1214


What does the file stdio.h contain?

1054


How do I get an accurate error status return from system on ms-dos?

1113


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1083


What is the role of this pointer?

1068


what is a function method?give example?

2356


How do you view the path?

1125