SHARE
TWEET

s

a guest Dec 3rd, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6.     int numbers[6]={10,50,30,40,100};
  7.     int a,j;
  8.     for(int i=0; i<6; i++)
  9.     {
  10.         for(j=i+1; j<6; j++)
  11.         {
  12.             if(numbers[i] < numbers[j])
  13.             {
  14.                 a = numbers[i];
  15.                 numbers[i] = numbers[j];
  16.                 numbers[j] = a;
  17.             }
  18.         }
  19.     }
  20.     for(int j=0;j<5;j++)
  21.     {
  22.         printf("%d",numbers[j]);
  23.         printf("\n");
  24.     }
  25.     return 0;
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top