diff --git a/even_no_sum/bin/Debug/even_no_sum.exe b/even_no_sum/bin/Debug/even_no_sum.exe new file mode 100644 index 0000000..5a20aa1 Binary files /dev/null and b/even_no_sum/bin/Debug/even_no_sum.exe differ diff --git a/even_no_sum/main.cpp b/even_no_sum/main.cpp new file mode 100644 index 0000000..947e71f --- /dev/null +++ b/even_no_sum/main.cpp @@ -0,0 +1,22 @@ +#include + +using namespace std; + +int main() +{ + int n,i; + + cout<<"Enter the range to find sum:"; + cin >> n; + + int sum = 0; + + for(i=0; i<=n; i++) + { + if(i%2 == 0) + sum += i; + } + cout<<"The sum of even numbers upto "< + +using namespace std; + +int main() +{ + int n,i; + + cout<<"Enter the range to find sum:" + cin >> n; + + int sum; + + for(i=0; i<=n; i++) + { + if(i%2==0) + { + sum += i; + } + } + cout<