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
#questThere is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doin

Create a pseudocode in getting Calendar Quarter. The program should identify which quarter falls the given date. Note: Consider the date format DDMMYYYY.

Prepare aime crossover alert expert adviso Project Description: Need to develop an expert advisor base on aime crossover alert indicator. Skills required is C Programming

Explain Register Variable Computers have internal registers, which are used to keep data temporarily, before any operation can be performed. Intermediate results of the calcula

Private derivation If no specific derivation is listed, then a private derivation is supposed. If a new class is derived privately from its parent class, then: The priva

c program of double linked list with full explanation

After p = new Fred[n], how does the compiler know about n objects to be destructed throughout delete[] p? A:  The run-time system hold the number of objects, n, somewhere where

WHAT IS CGI?

C Program for RADIUS OF CIRCLE   #define PI 3.14159 main() {           float r,a;           clrscr();           printf("ENTER THE RADIUS OF A CIRCLE: ");

Program is to append the contents of one file to another: void main()    {   clrscr();   fstream file1,file2;   char st1[13],st2[13];/* 13 because a filename canno