While cpp solution


#1
#include<iostream>

using namespace std;

int main()  {
    int N, i = 0;
    cin>>N;
    
    while (i < N)
    {
        if (i%2 != 0)
            cout << i << "\n";
        i++;
    }
    
    return 0;
}

#2

#include
using namespace std;

int main()
{
int N;
cin>>N;
int i = 1;
while(i<N)
{
cout<<i<<endl;
i = i+2;
}
i++;
return 0;
}


#3

Hey!! I tried the same approach but it was showing error!! Why so?