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
how to do 2, 4, 8 associativity

how to declare arrays

A: It allows a program to reference an identifier in global scope which has been hidden by another identifier along with the same name in the local scope.

Q:  Tells the operators one can override; which operators should he override? A: Bottom line: don't puzzle your users. Remember the reason of operator overloading: to decreas


What is the difference between early binding and late binding? What are advantages of early binding? a.) Late binding refers to function calls which aren't resolved until run t

When I develop a destructor, do I require to explicitly call the destructors for my member objects?

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

A: It is implementation dependent. Verify with your compiler's documentation. For instance, assume you wish to do binary I/O using std::cin & std::cout. Unluckily there is no st

Define the Volatile Keyword Qualifiers in C Language? The volatile keyword proceed as a data type qualifier and a volatile variable is for dynamic use. E.G. for data that is to