#include <iostream>
using namespace std;
int main()
{
cout << "odd numbers from 1 to 100 : ";
for (int i = 0; i <= 100; i++)
{
if (i % 2 != 0)
{
cout << i << ",";
}
}
}
#include <iostream>
using namespace std;
int main()
{
string even = "";
string odd = "";
for (int i = 0; i <= 100; i++)
{
if (i % 2 == 0)
{
even.append(to_string(i) + ", ");
}
else
{
odd.append(to_string(i) + ", ");
}
}
cout << "these numbers are even
"
<< even << endl;
cout << "these numbers are odd
"
<< odd << endl;
}