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

#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]=a[j];
a[j]=t;
}
}
}

Is This Answer Correct ?    144 Yes 123 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where are the auto variables stored?

1152


Describe the header file and its usage in c programming?

1072


what is the difference between 123 and 0123 in c?

1208


What are the features of the c language?

1088


Is file a keyword in c?

935


What is the code for 3 questions and answer check in VisualBasic.Net?

2161


Differentiate fundamental data types and derived data types in C.

1036


What is array in c with example?

1266


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

1315


Can a void pointer point to a function?

1025


Can we declare variables anywhere in c?

1001


Can the sizeof operator be used to tell the size of an array passed to a function?

1118


When should we use pointers in a c program?

1137


pierrot's divisor program using c or c++ code

2241


What are the data types present in c?

1163