Read numbers form user and place them in array, C/C++ Programming

Read numbers form user and place them in array:

Program is to read a group numbers of numbers form user and place them in array type of float and sort them

void sort(float a[]);

 int i,n;

 void main()

   {

    clrscr();

    float a[20];

    cout <<" enter  no of terms: ";

    cin>>n;

    cout<<" enter the elements ";

    for(i=0; i

     {

    cin>>a[i];

     }

    sort(a[i]);

   }

 

void sort(float a[])

  {

  int t,j,po;

  float min;

   for(i=0; i

    {

    min=a[i];

    po=i;

    for (j=i+1; j

     {

     if (a[j]

       {

      min=a[j];

      po=j;

       }

     }

  t=a[po];

  a[po]=a[i];

  a[i]=t;

  }

 for(i=0;i

 cout<<" sorted elements ";

 cout<

 }

Posted Date: 10/19/2012 5:44:21 AM | Location : United States







Related Discussions:- Read numbers form user and place them in array, Assignment Help, Ask Question on Read numbers form user and place them in array, Get Answer, Expert's Help, Read numbers form user and place them in array Discussions

Write discussion on Read numbers form user and place them in array
Your posts are moderated
Related Questions
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Which constructor gets called while I create an array of Fred objects?

Call by reference: Arguments to a function can be passed in two way; one by call by value and other by call by reference.  Call by value is passed either through a constant

example of program to add two number


Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

what is the syntax to get a coloured output.

Operators The variables, which are declared and explained, are the operands, which are operated upon by the operators. Operators specify what operations are to be performed on

Write an algorithm for multiplication of two sparse matrices using Linked Lists.

explain Storage management: free storage pool, garbage collection, compaction, boundary tag method; Hash tables and hashing functions