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 down the program to sort the array.

Answer Posted / rama krishna sidhartha

//code for ascending order
for(i=0;i<n-1;i++)
{
for(j=1+1;j<n;j++)
{
if(a[j] >a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}

//code for descending order
for(i=n-1;i>0;i--)
{
for(j=n;j>i+1;j--)
{
if(a[j]<a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you find the day of the week given the date?

1209


How is pointer initialized in c?

1043


what is different between auto and local static? why should we use local static?

1136


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2647


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3529


What is console in c language?

1109


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

1111


What is function what are the types of function?

1008


What is assignment operator?

1069


how to execute a program using if else condition and the output should enter number and the number is odd only...

2318


What are the types of data types and explain?

1098


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

1119


Why is c called c not d or e?

1106


Explain how can I make sure that my program is the only one accessing a file?

1235


What are the 4 types of functions?

1070