answersLogoWhite

0

#include <iostream>

using namespace std;

int main()

{

cout << "Even from 0-100: \n\n";

for(int i = 0; i <= 100; i++)

{

if(i % 2 == 0 && i != 0)

{

cout << i << endl;

}

}

cout << "Odd from 0-100: \n\n";

for(int i = 0; i < 100; i++)

{

if(i % 2 != 0)

{

cout << i << endl;

}

}

char wait;

cin >> wait;

return 0;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

If n is an odd integer is n plus 6 odd as well?

Yes. If n is odd, then n + c where c is an even constant will be odd. n + d where d is an odd constant will be even.


Can you add 2 odd numbers that equal an odd number?

no, b/c you can think of an odd number as an even number plus one. So if you add two odd numbers, you would be adding 2 even numbers plus 2... Let # be even... (#+1) + (#+1) = (#+#) + 2 two even numbers added together are always even


is 986 even or odd?

Even b/c if the last number is even then even and if the last number is odd then the number is odd so 986 _6_ is even


Can 5 odd numbers make 50?

No. Two odd numbers added together always give an even number. Two even numbers added together always give an even number. An odd and an even number added together always give an odd number. So, if we have 5 odd numbers - a, b, c, d and e a + b will be even c + d will be even So if (a + b) + (c + d) is even, adding e to that will have to be an odd number - but 50 is even, so it cannot be done.


Why is it if you ADD an odd number plus an odd number plus an odd number equals an odd number?

The simple explanation is based on the two rules: Odd+Odd = Even and Even+Odd = Odd Adding the first two Odd numbers (rule 1) gives an Even number. Then adding the Odd (rule 2) gives the Odd final answer. The mathemetical proof goes as follows: An odd number is one that, when divided by 2, leaves a remainder of 1. So, as odd number can always be written in the form 2x + 1 where x is an integer. Now suppose 2a+1, 2b+1 and 2c+1 are three odd numbers where a, b and c are integers. (They need not all be different). Then their sum is 2a+1+2b+1+2c+1 = 2a+2b+2c+2+1 = 2(a+b+c)+1 which is of the same form as 2x+1 (with a+b+c replacing x).


Even or odd in c plus plus program?

#include &lt;iostream&gt; int main() { int num; std::cout &lt;&lt; "Enter a number: "; std::cin &gt;&gt; num; if(num % 2 == 0) { std::cout &lt;&lt; "Number is even"; } else { std::cout &lt;&lt; "Number is odd"; } return 0; }


Is fx equals c an even or odd function?

Even (unless c = 0 in which case it is either or both!)


Why when you add 3 odd numbers together you get an odd number as the sum?

Because three odd numbers can be expressed as 2a + 1, 2b + 1 and 2c + 1. Adding these gives 2(a + b + c) + 3: 2(a + b + c) is obviously even, being a multiple of 2, and 3 is equally obviously 1 more than another even number, so your total comprises two even numbers plus 1, ie an odd number.


How do you write a C program to check whether the number is odd or even Ps-using DEV complier?

To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.


C program to accept a sequence of number terminated by zero and sum all odd nos and even nos?

#include &lt;stdio.h&gt; main() { int n, odd=0, even=0; while (scanf("%d",&amp;n)&amp;&amp;(n!=0)) (n%2)?++odd:++even; printf("odd: %d even: %d\n",odd,even); }


Write a single line code in C to find a given number is even or odd?

printf ("%d is %s\n", n, n%2 ? "odd": "even");


What are 5 odd nos between 1 to 19 are adding equal to 50?

It's impossible. Adding 5 odd numbers will always result in an odd number. 50 is an even number. Here's how. Let the five odd numbers be: 2a+1, 2b+1, 2c+1, 2d+1, and 2e+1; where a,b,c,d &amp; e are any whole numbers. This guarantees that they are odd, since multiplying by 2 gets and even then an even plus one will be an odd. So we have 2a+1+2b+1+2c+1+2d+1+2e+1. Rearranging we have 2a+2b+2c+2d+2e+5 = 2(a+b+c+d+e) + 5. So 2(a+b+c+d+e) is even, then you add 5 and it's odd.