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
Aim: To implement a program to create, update & display account & admin record of person using display account & admin records of person using virtual base class.. Code:

A: No.       While realloc() need to copy the allocation, this uses a bitwise copy operation, that will tear several C++ objects to shreds. C++ objects must be allowed to copy t

In rPeANUt implement the "char getchar()" and "void printstring(char *str)" functions. Using these functions implement the following: void main() {    while (1) {       ch

#include #include #include void* memorycopy (void *des, const void *src, size_t count) {   size_t n = (count + 7) / 8;   char* destination = (char *) des;   char* source =

C program for function  of average int average(int); void main() {           int max=0,c=0;           clrscr();           printf("ENTER THE LIMIT OF INPUT FOR AV

Write a algorithm to explain the processof wakingbup in morning

Hello, I would like to know if you can help in C programs that work on android.

Define the Increment and Decrement Operators in c language? C offers two special operators -and ++ called decrement and increment operators respectively and these are unary ope

Write a program to act as an electronic safe. If the correct code has been entered the program should display "Safe Open".  If an incorrect code is input it should display "Alarm"

#A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of