answersLogoWhite

0


Best Answer

#include

using std::cout;

using std::endl;

int main()

{

int sum = 0;

cout << endl << "Sum is: ";

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

{

sum += i;

}

cout << sum << endl;

system("PAUSE");

return 0;

}

* The code was compiled in VS2008.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: To write a program that calculates and prints the sum of all even numbers between 0 and 100 in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program to aceept 5 numbers from keyboard n print itz total?

Sure! Here's a simple Python program that allows the user to input 5 numbers and then calculates and prints their total: numbers = [] for i in range(5): num = int(input(&quot;Enter a number: &quot;)) numbers.append(num) total = sum(numbers) print(&quot;The total is:&quot;, total) This program prompts the user to enter a number 5 times, converts each input to an integer, stores them in a list, calculates the sum of the numbers using the sum() function, and finally prints the total.


How do you write a program which reads a list of ten numbers and print the list in reserve order in c program?

The simplest way is probably to read the numbers into an array and then prints each element of the array starting at the last one and moving backwards.


What is one tool for reverse engineering software and five features of that tool?

hexadecimal dumper, which prints or displays the binary numbers of a program in hexadecimal format.


Demonstrate a program that prints numbers in ascending order.?

#include&lt;iostream&gt; int main() { for (int i=0; i&lt;100; ++i) std::cout&lt;&lt;i&lt;&lt;std::endl; }


Write a program that calculates and prints the sum of the even integers from 2 to 30?

For N = 2 to 30 STEP 2 Sum = Sum + N Next N Print "The sum is "; Sum; ". Have a nice day. Come back and see us." END


How did menu's develop?

A restaurant prints it out using a special program


Create a program which accepts a number not less than 10The program prints the reverse of the number?

ten


How do you write a c program that prints a box an oval an arrow and a diamond?

You first learn how to program in C.


C plus plus program using for loop that prints all even numbers between and including 10 and 1000?

#include using std::cout;using std::endl;int main(){cout


What is the difference between finger prints?

Nobody's finger prints are the same. Every person in the world has different finger prints. Even identical twins have different prints.


A program prints vertically a numbers in c program?

It is too easy................ //Program to print numbers vertically #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int last_no; int i; clrscr(); i=0; printf("Enter your last num.I will print 0 to that number"); scanf("%d",&amp;last_no); printf("\n"); while(i&gt;last_no) { printf("%d\n",i); i++; } getch(); } //poo.papule


Is there anything common between tiger skin and human finger prints?

ytiger skin protects the tiger but human prints are just some prints of humanns.