Horje
even and odd sum in c++ Code Example
even and odd sum in c++
#include<iostream>
using namespace std;

int main()
{
	do
	{
		int num, even = 0, odd = 0;

		for (int i = 0; i < 8; i++)
		{
			cin >> num;
			if (num % 2 == 0)
				even += num;
			else
				odd += num;
		}

		cout << "Even: " << even << endl;
		cout << "Odd: " << odd << endl;

	} while (true);
	

	return 0;
}




Cpp

Related
pycuda install failed microsoft c++ Code Example pycuda install failed microsoft c++ Code Example
iterate through map Code Example iterate through map Code Example
char Code Example char Code Example
labs c++ Code Example labs c++ Code Example
how to point to next array using pointer c++ Code Example how to point to next array using pointer c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7