# include <iostream>
using namespace std;
int main ()
{
int arr[100], num, sum=0, size=0;
cout<<"Enter an integer: ";
cin>>num;
if (num < 0) num*=-1;
while (num != -999 && size < 100)
{
arr[size]=num;
size++;
cin>>num;
for (int j=1; j<size; j++)
{
for (int i=0; i<size-1; i++)
{
if (arr[i]>arr[i+1])
{
int temp=arr[i];
arr[i]=arr[i+1];
arr[i+1]=temp;
}
}
}
int cont=1;
for (int i=1; i<100; i++)
{
if (arr[i-1]=arr[i])
{
cout<<arr[i-1]<<"\t"<<cont<<endl;
cont=1;
}
else
{
cont++;
}
cout<<arr[i]<<cont<<endl;
}
}
return 0;
}
it must take numbers from user and sorted them to incresing order, then cout them with number of reptiton times.
the output shoud be like that:-
Numbers Count
13 1
15 2
28 2
40 1
48 1
62 3
65 3
95 4
thanx,
buy :)