Prompts the user to input 2 integers firstNum and secondNum // Easy

Output all odd numbers between firstNum and secondNum // No idea how to start that.

Outputs the sum of all even numbers between firstNum and secondNum

Output the numbers and their squares between 1 and 10

Output the sum of the square of the Odd Numbers between firstNum and secondNum

These would all be easier to do with a for loop really, but if you're required to create a while loop, use this pseudocode to help..

while i < second num

{

//code

i++

}

In order to find if they're even numbers, use i%2 and if it equals 0, then it's even. Otherwise it's odd. A simple if/else can help there.

sum += sum + i;

Make sure you start sum at 0 before the loop.

I'm not sure I understand what the 'Output ALL Uppercase numbers' is?

`#include <iostream> using namespace std; int main() { cout << "Please input 2 integers: "; cin >> firstNum >> secondNum; cout << endl; ////while (firstNum >= secondNum) <<-- Dont use it like that`

this way would be better,

int i = firstNum;

int sum = 0, sum2 = 0;

While ( i < secondNum )

{

if ((i %2) == 0)// for odd if (i%2 == 1) is odd

sum +=i; //<-- sum all the even number, if you want odd

else// the if its not even then it is odd

{

cout<< i << " ";

sum2+= i*i;// for the square

}

i++;

}

```
#include <iostream>
using namespace std;
int main()
{
int i = firstNum;
int sum = 0, sum2 = 0;
cout << "Please Enter 2 Integers: ";
cin >> firstNum >> secondNum;
cout << endl;
while (i < secondNum)
{
if ((i %2) == 0)
if (i%2 == 1)
sum +=i;
{
cout<< i << " ";
sum2+= i*i;// for the square
}
i++;
}
return 0;
}
```

very skeletal but working, on it ^^; another tip ?

```
#include <iostream>
using namespace std;
int main()
{
int i;
int sum = 0, sum2 = 0;
cout << "Please Enter 2 Integers: ";
cin >> firstNum >> secondNum;
cout << endl;
i = firstNum; // <== Should be here so the input value goes here.
while (i < secondNum)
{
if ((i %2) == 0)
if (i%2 == 1)
sum +=i;
{
cout<< i << " ";
sum2+= i*i;// for the square
}
i++;
}
return 0;
}
```

```
#include <iostream>
using namespace std;
int main()
{
int i;
int sum = 0, sum2 = 0;
i = firstNum;
while (i < secondNum)
{
cout << "Please enter 2 integers, the first must be smaller then the second: ";
cin >> firstNum >> secondNum;
cout << endl;
if ((i %2) == 0)
if (i%2 == 1)
sum +=i;
{
cout<< i << " ";
sum2+= i*i;
}
i++;
}
return 0;
}
```

Write a program that uses while loops and performs the following

Prompts the user to input 2 integers firstNum and secondNum // Easy

Output all odd numbers between firstNum and secondNum // No idea how to start that.

Outputs the sum of all even numbers between firstNum and secondNum

Output the numbers and their squares between 1 and 10

Output the sum of the square of the Odd Numbers between firstNum and secondNum

Output ALL Uppercase letters***.

*Bump*

Im at a roadblock

```
#include <iostream>
using namespace std;
int main()
{
int i;
int firstNum, secondNum;
int evensum = 0;
int oddsum = 0;
cout << "Please enter 2 integers: ";
cin >> firstNum >> secondNum; //moved this here from
//the loop so i got a value
if (firstNum < secondNum) //first num is smaller
//so i is first num
i = firstNum;
else //else second num is smaller
{
i=secondNum; //sets i to smaller number
secondNum=firstNum; //sets second number to larger number
firstNum=i; //copies smaller number from i
}
while (i <= secondNum) //needs to be <= so you get last number
{
if ((i %2) == 0) //if number is even
evensum += i;
else //not even, so it's odd
oddsum += i;
i++;
}
return 0;
}
```

There, I fixed the code you had and commented the fixes so you could follow. That should give you a start. It gets you the even/odd sum. If you need more help, let me know.