I'm to write a C++ program that will add up all the odd numbers from 1 through 3579 and all of the even numbers from 522 through 2222. WHILE LOOPS MUST BE USED!!!

The output is to be in the format:

The sum of the odd numbers from 1-3579 is:

The sum of th eeven numbers from 522 through 2222 is:

This is what I've so far...all the help is appreciated...

#include <iostream> #include <string> #include <cmath> using namespace std; int main() { int num, odd, even, oddz, evenz; for (num % 2 != 0 && num % 2 == 0) while (odd != 3579); { oddz = oddz + odd; odd += 2; } while (int i = 522; i < 2222; i += 2) cout<<"The sum of the odd numbers from 1 through 3579 is : "<<oddz<<endl; cout<<"The sum of the even numbers from 522 through 2222 is : "<<evenz<<endl; return 0; }