How do i display the first or last to odd and even number?
this is the code ..but it is not displaying the first and the last number that came from the user.
anyone can help me with this small problem??
cout<<"Enter the First digit:";
cout<<"Enter the Last digit:";
cout<<"The Odd numbers/digits between "<<f<<" and "<<l<<" Are: "<<endl;
cout << "And Even numbers/digits between "<<f1<<" and "<<l<<" are:"<<endl;
Enter the first number:1
Enter the Last number:10
The Odd numbers between 1 and 10 are:
And the even number between 1 and 10 are:
Firstly, please use code tags (there's still time to edit your post and put them in).
For your for loops, you are incrementing your values in your initialization step (and thereby skipping over the first value) and you were losing your last (if you want it) by having a termination condition that was < instead of <=: for ([COLOR="Red"]f++[/COLOR];f<l;f++) in both cases
Use a different variable if you can and have for (int index = f;index <=l;index++) (for example) In that same vein don't use 1 letter variable names, there's no savings there and there is a decrease in readability.
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"