I need to sort the product number in ascending order when all the products are displayed. Please help. Here is my code:
int product_number;
char product_name[150];
float product_price = 0,product_quantity = 0,product_discount = 0;
int i = 0;
int product_array[100];
public:
void generate_product()
{
while (1)
{
cout << endl << "Enter the product number: ";
cin >> product_number;
if (product_number < 0)
{
cout << "Invalid input!";
continue;
}
int flag = 0;
for (int j = 0; j < i; j++)
{
if (product_array[j] == product_number)
{
cout << "Invalid input";
flag = 1;
break;