I am totally confused I cant even get started and my assignment is getting later by the day. We have to use a while loop to do several things. This is the source code I have so far , can someone tell me where to go from here
This is me trying to print odd numbers from 2 numbers input by the user. I also have to sum and print the even numbers. I have to print squares of numbers between 1 and 20.
This is me trying to print odd numbers from 2 numbers input by the user. I also have to sum and print the even numbers. I have to print squares of numbers between 1 and 20.
Code:
// Source Code
# include <iostream>
using namespace std;
int main
int firstnum;
int 2ndnum;
int odds;
int sumevens = 0;
int counter;
string uppercaseLetters;
sum = 0
cout << " Please input 2 integers,make the 2nd number larger than the first number"
cin >>firstnum>>2ndnum
cout << " The first number entered is :"<< first num;
cout<< " the 2nd numberentered is:" << second num;
cout << endl;
while ((firstnum < second num)&& firstnum % 2 = 0))
cout << firstnum++
else if((firstnum < second num)&& firstnum % 2 = 1)
cout<< sumevens
sumevens= sumevens + num
//Do I need to use a counter. How do I get it to go on to the next odd integer?
Comment