Write a c program to sort in ascending order of n numbers, Computer Engineering

Assignment Help:

Write a C program to sort in ascending order of n numbers.

# include

# include

void main()

{

int a[25],no,i,j,m,t;

clrscr();

printf("\nEnter Total number of inputs : ");

scanf("%d",&no);

printf("\nEnter %d number : ",no);

no--;

for(i=0;i<=no;i++)

scanf("%d",&a[i]); /* Enter array elements */

for(i=0;i<=no;i++) /* Number of Passes */

{

for(j=0;j

/*Compare an element with the next element one by one*/

{

if(a[j]

{

t=a[j]; /* Interchange the two if first is smaller */

a[j]=a[j+1];

a[j+1]=t;

}

}

}

printf("\n Sorted numbers are :\n");

for(i=0;i<=no;i++)

printf("%d",a[i]);

getch();

}

 


Related Discussions:- Write a c program to sort in ascending order of n numbers

Show the mailing lists on internet, Q. Show the Mailing lists on Internet? ...

Q. Show the Mailing lists on Internet? Another exciting aspect about E-mail is that you can find groups of people who share your interests-whether you are inclined toward games

Discuss about fourth generation electronic computers, Fourth Generation (19...

Fourth Generation (1972-1984) The next generation of computer systems used the large scale integration (LSI -1000 devices per chip) and very large scale integration (VLSI - 100

Sets and bags, Task: Sets and bags In mathematics, the notion of multis...

Task: Sets and bags In mathematics, the notion of multiset (or bag) is a generalisation of the notion of set. A bag is a special kind of container in which the items may be

Specifying the problem - learning decision trees, Specifying the Problem: ...

Specifying the Problem: Now next here furtherly we now use to look at how you mentally constructed your decision tree where deciding what to do at the weekend. But if one way

Fuzzy logic - artificial intelligence, Fuzzy Logic - artificial intelligenc...

Fuzzy Logic - artificial intelligence: In the above logic, we have been concerned with truth whether propositions and sentences are true. But, with some natural language statem

Show the categories of web browser, Q. Show the categories of Web browser? ...

Q. Show the categories of Web browser? The two basic categories of Web browser are: • Text-only browsers: A text-only browser like Lynx allows you to view Web pag

Determine the negation of the statement, Determine the negation of the stat...

Determine the negation of the statement? "2 is even and -3 is negative"? Answer: 2 is odd or -3 is not negative.

What is the linkage section, The linkage section is part of a known as prog...

The linkage section is part of a known as program that 'links' or maps to data items in the calling program are working storage. It is the part of the called program where these sh

What is ai backgammon, This part looks at Berliner's program, two backprop ...

This part looks at Berliner's program, two backprop versions by Tesauro and a temporal difference process by Tesauro. This latter program is VERY good quality and has found strateg

Applications of generic framework for e-commerce executed, How are applicat...

How are applications of generic framework for e-commerce executed? To execute applications, this is essential to have Supporting Information and Organizational Infrastructure a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd