Write a C++ program that find the sum of all even numbers between 1 and 30 excluding 6, 8, 24 and 28
###### Posted by Samath
Last Updated: November 02, 2014

With the aid of a while loop create a C++ program that finds the sum all the even numbers between 1 and 30. Do not include the numbers 6, 8, 24 and 28 in the final accumulation of these even numbers.

Here is the Solution to the problem above:

```#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int count = 1, sum = 0;
while (count < 30)
{
if(count % 2 == 0)
{
if(count!=6 && count!=8 && count!=24 && count!=28)
{
sum += count;
}
}

count ++;
}

cout<<"Result: "<<sum;
cout<<endl;
return 0;
}
```
###### Sum of two values in C
Samath | Nov 09, 2014
###### C Program to find sum of two numbers
Samath | Jan 02, 2017
###### C++ Calculate the sum from 1 to 100
Samath | Jan 05, 2017
###### How do you show the list of commits that are reachable from a specified commit, excluding commits reachable from another specified commit?
AliceWk | Jul 21, 2024
###### How do you show the list of commits that are reachable from the current commit, excluding commits reachable from another specified commit?
BobHarris | Jun 06, 2024
###### How can you find the sum of elements in a list using the sum() function in Python?
QuinnLw | Aug 19, 2024
###### Sum of the first 30 squares in C
Samath | Dec 21, 2014
###### Write a Python function to calculate the sum of digits of a number.
MaryJns | Aug 17, 2024
###### Java program that uses a loop to compute the sum of all odd digits of an input. (For example, if the input is 32677, the sum would be 3 + 7 + 7 = 17.)
Samath | Apr 03, 2022
###### Recursive function that find the sum of digits in a integer using C++
Samath | Dec 24, 2014
###### C Program to calculate sum of 5 subjects, calculate percentage and grade
Samath | Jan 02, 2017
###### C program to find sum of elements of the array
Samath | Jan 02, 2017
###### Java program that prints the sum of the first ten positive integers
Samath | Jan 08, 2021
###### Java program that uses a loop to compute the sum of all even numbers between 2 and 100 (inclusive)
Samath | Apr 03, 2022