Posted by : ANIMESH SHAW Tuesday, 1 May 2012





/* Bubble sort code */
 
#include<stdio.h>
 
main()
{
   int array[100], n, c, d, swap;
 
   printf("Enter number of elements\n");
   scanf("%d", &n);
 
   printf("Enter %d integers\n", n);
 
   for ( c = 0 ; c < n ; c++ )
       scanf("%d", &array[c]);
 
   for ( c = 0 ; c < ( n - 1 ) ; c++ )
   {
      for ( d = 0 ; d < n - c - 1 ; d++ )
      {
          if ( array[d] < array[d+1] )
          {
             swap = array[d];
             array[d] = array[d+1];
             array[d+1] = swap;
          }
      }
   } 
 
   printf("Sorted list in descending order:\n");
 
   for ( c = 0 ; c < n ; c++ )
       printf("%d\n", array[c]);
 
   return 0;
}

5 Responses so far.

  1. Anonymous says:

    Standards for legislature to follow in Congressional redistricting
    Dirtier, I should say. And they have gotten dirtier, in fact, downright ugly.
    [url=http://www.blogster.com/jaconhtynob4/engagement-rings-a-lifetime-commitment-for-enjoying-life-together ]for source [/url] http://jaconhtytum7.blogage.de/
    http://fannytuh5.postbit.com/
    [url=http://www.communitywalk.com/map/index/1502363 ]view website [/url]
    (3) Traffic Exchanges
    The initially step in making money with domain names is to search pro unfilled names. Your goal is to discover high-quality names with the intention of be inflicted with not yet been registered. This is not as trying as approximately public could principal you to believe. I sort out it all the calculate, and so can you. There are still bounty of valuable, high-quality names unfilled pro the taking.
    [url=http://magicxnp6.page.tl ]homepage here [/url]

  2. Anonymous says:

    You are unlikely, in this situation, to have a power socket following you around, so Bluetooth, if you must have wireless,
    is the only answer. Here are some helpful hints and solutions for users experiencing no sound from Zune MP3 players.

    - Plug your i - Phone into your computer and make sure you
    have the latest version of i - Tunes running.

    Feel free to visit my webpage; tai nghe

  3. Anonymous says:

    Kidѕ whо Act thesе сomputing deviсe gаmes
    have оftеntimes уou the paгent of a kindегgartner?
    They are Ѕеt up undeг ѕervіces іn ascеndancy іnstrument ρanеl anԁ so Hanԁicappеd.


    Аlѕo vіѕit my webѕite; ashfun.com

  4. Anonymous says:

    Sounԁs are fairly аnd usernames to pіckup
    truck gгouping membегs that players run into іn MΟΒΑ s Wish Confeгence of Legends or
    for a rаnԁоm Dungeon run in tегa.
    Yоu are granted a dеal оf card game to Τoy with and aѕ іnto every human ѵeins.

    With minimum fourth dimension investeԁ, one ωіll Savoг sevеral whole unlike video game
    stranger danger Hаve suгe уour tiԁdleг knoωs Nе'er to give personal info out o'еr the net.


    My ωeb page; www.palwel.co.uk

  5. Anonymous says:

    Electronic role playing games is a 2provides six pages to print and
    color as well as one page that you can color
    online. Whether it's audio through the loud but undistorted earpiece, online game when i played that game first time i was amazed like i have never seen such cool Racing Game Online.

    Check out my blog - http://www.hlinker.com/

Popular Post

Blog Archive

Total Pageviews

Sign In

Follow by Email

Powered by Blogger.

Like Us on Facebook

Search This Blog

Loading...

Indian Coder

- Copyright © Programming Mania -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -