Nested Loop
Tue Oct 10 2023 08:33:24 GMT+0000 (Coordinated Universal Time)
Saved by
@akaeyad
#include <iostream>
using namespace std;
int main()
{
string products[] = {"Item 1", "Item 2", "Item3"};
string sizes[] = {"Small", "Large", "X-Large"};
for (int i = 0; i < 3; i++)
{
cout << "Product Name: \n";
cout << products[i] << "\n";
cout << "Sizes: \n";
for(int j = 0; j < 3; j++)
{
cout << sizes[j];
if(j < 2)
{
cout << ", ";
}
}
cout << "\n";
cout << "=====================\n";
}
return 0;
}
content_copyCOPY
Comments