tided it up a bit and the data is now stored in an array
-
#include<iostream.h>
-
-
class loops
-
{
-
public:
-
void display(int num[10])
-
{
-
int times;
-
for(times=0;times<10;times++)
-
{
-
cout<<endl<<"Enter a number";
-
cin>>num[times];
-
num=num;
-
}
-
}
-
-
void loops::output(int num[10])
-
{
-
int n;
-
for(n=0;n<10;n++)
-
{
-
cout<<endl<<"Number is :"<<num[n];
-
}
-
}
-
};
-
int main()
-
{
-
int num[10];
-
//clrscr();
-
loops l1;
-
l1.display(num);
-
l1.output(num);
-
getchar();
-
}
-
you now need to sort the data in the array!
don't use conio.h unless you have a good reason - it is non standard and not available with many compilers.
also if possible replace
which uses a deprecated header with
-
#include<iostream>
-
using namespace std;
-
however, this does not work with many older compilers