cout<<"how many elements you want to insert for sorting:";
cout<<" " <<arr[cnt];
cout<<"\n\nsmallest number is:"<<arr;
cout<<"\nbiggest number is:"<<arr[--cnt];
By using this code you can find biggest and smallest number also you can sort a whole list of numbers in ascending order. Here in this program i used selection sort method you read more methods of sorting in your book good luck.
@ Nandu Das The purpose of this forum is to help not to just give you the code. If you are having a particular problem with this problem then state what that is and we can help. With that said you can do this very simply. you will need three variables and a while loop. I would use min, max and input and I would set them all to 0. Ask the user to enter a number and store that number into min and max. Then in a while loop that loops forever ask the user to enter a number or something like -999 to quit. use cin >> input; to get the number entered by the user. Then compare input to -999. If it is equal then break the loop. if not then see if the number is less than min. if it is then set min = input. Then check to see if input is greater than max. If it is than set max = input.