C++

Write a Program that Stores Five Values in an Array. It Sorts the Array Using Bubble Sort. It also Displays the Values of Unsorted and Sorted Array.

By April 8, 2016 November 9th, 2016 27 Comments

#include<iostream.h>
#include<conio.h>
void main( )
{
int arr[5], i, j, temp;
for(i = 0; i < 5; i++)
{
cout << “Enter Value: ”;
cin >> arr[i];
}
cout << “The Original Values in Array:\n”;
for(i = 0; i < 5; i++)
cout << arr[i] << “ ”;
for(i = 0; i < 5; i++)
for(j = 0; j < 4; j++)
if(arr[j] > arr[j + 1])
{
temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
cout << “\n The Sorted Array:\n”;
for(i = 0; i < 5; i++)
cout << arr[i] << “ ”;
getch( );
}



27 Comments

  • yeezy boost says:

    My wife and i ended up being comfortable when Ervin could do his investigation via the ideas he was given from your web site. It is now and again perplexing to just be giving freely thoughts that many people might have been selling. Therefore we discover we have got the website owner to thank because of that. These explanations you made, the easy blog menu, the relationships your site make it possible to foster – it’s all excellent, and it’s leading our son in addition to us know that that idea is awesome, which is certainly exceedingly important. Thanks for the whole thing!

  • I simply wanted to thank you very much yet again. I’m not certain the things that I would’ve sorted out without the type of points provided by you about that topic. It has been the traumatic difficulty in my view, nevertheless taking a look at this skilled technique you solved the issue made me to cry for gladness. Extremely thankful for your advice and as well , believe you realize what a powerful job your are carrying out training most people using your webpage. More than likely you have never encountered all of us.

  • I抦 impressed, I must say. Actually not often do I encounter a weblog that抯 each educative and entertaining, and let me let you know, you could have hit the nail on the head. Your concept is excellent; the issue is one thing that not sufficient persons are speaking intelligently about. I am very glad that I stumbled throughout this in my search for something regarding this.

  • WONDERFUL Post.thanks for share..extra wait .. ?

  • You made some first rate factors there. I seemed on the internet for the difficulty and located most individuals will associate with together with your website.

  • After I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a remark is added I get four emails with the same comment. Is there any method you’ll be able to take away me from that service? Thanks!

  • This website is really a stroll-by means of for all the data you needed about this and didn抰 know who to ask. Glimpse here, and also you抣l definitely uncover it.

  • You need to take part in a contest for the most effective blogs on the web. I will advocate this web site!

  • I wish to convey my gratitude for your kindness giving support to individuals that absolutely need help with this issue. Your personal commitment to getting the solution throughout came to be certainly invaluable and has always permitted individuals just like me to get to their ambitions. Your new warm and helpful guide indicates so much a person like me and far more to my office workers. Regards; from each one of us.

  • roshe run says:

    Spot on with this write-up, I actually suppose this website wants much more consideration. I抣l in all probability be once more to learn much more, thanks for that info.

  • Would you be desirous about exchanging hyperlinks?

  • A formidable share, I just given this onto a colleague who was doing just a little analysis on this. And he the truth is bought me breakfast as a result of I found it for him.. smile. So let me reword that: Thnx for the treat! However yeah Thnkx for spending the time to debate this, I really feel strongly about it and love reading more on this topic. If doable, as you develop into expertise, would you thoughts updating your weblog with more details? It is highly useful for me. Huge thumb up for this weblog publish!

  • yeezy boost says:

    I not to mention my buddies were checking out the excellent information from your website and then all of the sudden I had an awful suspicion I never expressed respect to the web blog owner for those techniques. All of the men are actually totally joyful to see all of them and have in reality been taking pleasure in them. Many thanks for genuinely really accommodating and for getting these kinds of smart information most people are really desperate to be informed on. Our own honest apologies for not saying thanks to you earlier.

  • Can I just say what a relief to seek out someone who really knows what theyre talking about on the internet. You undoubtedly know the way to deliver an issue to light and make it important. More folks have to learn this and perceive this side of the story. I cant consider youre no more fashionable because you definitely have the gift.

  • I’m often to running a blog and i actually recognize your content. The article has really peaks my interest. I’m going to bookmark your site and keep checking for new information.

  • I just want to say I am just all new to blogging and site-building and seriously loved your web page. Probably I’m planning to bookmark your blog . You really have really good stories. Appreciate it for sharing with us your webpage.

  • yeezy shoes says:

    I am also commenting to let you be aware of of the superb discovery my friend’s daughter developed reading your site. She came to find a wide variety of things, not to mention what it’s like to have an amazing coaching style to get other people easily master several advanced subject matter. You really exceeded my expected results. Thanks for producing such practical, healthy, explanatory and fun guidance on this topic to Janet.

  • air yeezy says:

    Hey! I just wish to give an enormous thumbs up for the nice info you might have right here on this post. I will probably be coming again to your blog for extra soon.

  • This really answered my downside, thank you!

  • hermes belt says:

    After I initially commented I clicked the -Notify me when new feedback are added- checkbox and now each time a remark is added I get four emails with the same comment. Is there any approach you possibly can remove me from that service? Thanks!

  • Thank you for each of your labor on this web page. My daughter really loves working on investigations and it is simple to grasp why. We hear all about the dynamic medium you offer both useful and interesting things via this web blog and even encourage response from people on that content so our simple princess is without question learning a lot. Have fun with the rest of the new year. You are always carrying out a really good job.

  • Would you be serious about exchanging links?

  • There’s noticeably a bundle to know about this. I assume you made sure good points in features also.

  • I’m typically to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your website and hold checking for brand new information.

  • When I initially commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the identical comment. Is there any means you possibly can take away me from that service? Thanks!

  • yeezy boost says:

    Thanks for all your valuable labor on this blog. Debby takes pleasure in participating in research and it’s simple to grasp why. Many of us learn all about the dynamic mode you produce simple guidelines by means of the website and in addition increase contribution from others about this concept then my child is certainly understanding a great deal. Take advantage of the rest of the new year. You are performing a brilliant job.

  • After study a few of the blog posts on your website now, and I actually like your method of blogging. I bookmarked it to my bookmark website list and will be checking again soon. Pls check out my website as effectively and let me know what you think.

Leave a Reply