Skip to main content

C program to arrange the given numbers in descending order



/* Write a C program to arrange the given
   numbers in descending order */


main ()
{
  int i,j,a,n,number[30];
  printf ("Enter the value of N\n");
  scanf ("%d", &n);
  printf ("Enter the numbers \n");
  for (i=0; i<n; ++i)
  scanf ("%d",&number[i]);
  for (i=0; i<n; ++i)
  {
    for (j=i+1; j<n; ++j)
      { if (number[i] < number[j])
  { a        = number[i];
   number[i] = number[j];
   number[j] = a;
  }
      }
  }
  printf ("The numbers arrenged in ascending order are given below\n");
  for (i=0; i<n; ++i)
  printf ("%10d\n",number[i]);
  }

Also Read : 

1)  Principles of Server Virtualization

2) Top Ten Data Storage Tools

3) Implement a simple calculator (detailed comments on JAVA code)

4) What is a Livelock scenario in java?

5) What is Disk scheduling algorithm in java ( code Example) 

6) What is a Deadlock situation in Java? What are the minimum requirements for a Deadlock situation in a program in Java? How can we prevent a Deadlock in Java?

7) Recursion-maze problem - Rat in the Maze - Game

8) What are features ,  Advantages and disadvantages of Javascript?

9) C program to read a file and display its contents along with line numbers before each line.

10) C++ program to find LCM and HCF of given 3 numbers


11)  What is cloud computing technology and what are the concepts, principles, applications, and prospects for cloud computing technology?

12) What are the basic characteristics of enterprise cloud computing, and what are the main stages in the construction process?

13) 20 best practices for database design

14) Best practices for DB2 database index design

Comments

  1. initialize an array a[30] and get the numbers check a[0]>a[i] for i=2to29 if true store it in another array b[30] in b[0] else check with a[1] and do the same tis should be reapeted again and again until b[30] is totally filled an finally print array b using a for loop !use tis algorithm to create cause i cant type the whole

    ReplyDelete

Post a Comment

Popular posts from this blog

8 common methods for server performance optimization

  1. Use an in-memory database In-memory database is actually a database that puts data in memory and operates directly. Compared with the disk, the data read and write speed of the memory is several orders of magnitude higher. Saving the data in the memory can greatly improve the performance of the application compared to accessing it from the disk. The memory database abandoned the traditional way of disk data management, redesigned the architecture based on all data in memory, and made corresponding improvements in data caching, fast algorithms, and parallel operations, so the data processing speed is faster than that of traditional databases. Data processing speed is much faster.       But the problem of security can be said to be the biggest flaw in the memory database. Because the memory itself has the natural defect of power loss, when we use the memory database, we usually need to take some protection mechanisms for the data on the memory in advance, such...

Recursion-maze problem - Rat in the Maze - Game

  package com.bei.Demo01_recursion; public class MiGong {     public static void main(String[] args)  {         //First create a two-dimensional array to simulate the maze         int [][]map=new int[8][7];         //Use 1 for wall         for (int i = 0; i <7 ; i++) {             map[0][i]=1;             map[7][i]=1;         }         for (int i = 0; i <8 ; i++) {             map[i][0]=1;             map[i][6]=1;         }         //Set the bezel         map[3][1]=1;         map[3][2]=1;         //Output         for (int i = 0; i <8 ; i++) {             for (int j = 0; j ...

AirBnB Infographic Journey to IPO

  Full Post at  https://techpomelo.com/2020/10/infographics-airbnb-milestone-journey-to-ipo/