answersLogoWhite

0


Best Answer

In C:

#include <stdio.h>

int

main(void) {

int i, sum=0;

for (i=10; i<=40; i+=2) {

sum += i;

}

printf("%d\n", sum);

return 0;

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include<stdio.h>

#include<conio.h>

void main()

{

int i,sum=0;

clrscr();

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

{

sum=sum+i;

}

printf("sum is %d",sum);

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

int sum = 0;

for(int i = 10; i <= 40; i += 2) {

sum += i;

}

printf("Sum of all even numbers between 10 and 40(inclusive) is %d\n", sum);

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include <stdio.h>

int main (void)

{ puts ("2 4 6 8 10 12 14 16 18 20"); }

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 10 and 40 I have tried but i will waste characters showing it.?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

How do you write a program that calculates the sum of the matrix elements given numbers?

ring me and ill explain - 086 22222222222222227 ring me


What is Excel on computers?

Excel is a specialized program that manages numbers in various ways. It uses spreadsheets and data to process a large amount of numbers. One enters the data, or numbers, and the program calculates the numbrs in the manner you designate in the program.


Which application software calculates numbers such as a teachers grade book program?

Microsoft office excel you can use for any kind of calculations


Program in 'c' to find the LCM of any given five numbers?

Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.


How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?


What are the answers for Programming logic and design chapter 6?

program calculates


How do you write a c program which calculates the value of money at the end of each year of investment?

Reference:cprogramming-bd.com/c_page3.aspx#calculates the value of money


Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i &lt;= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.


Using while loop write a program which calculates the product of digits from 1 to 5 and also show these nos vertically?

Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.


Is a program with no input an incorrect program?

No, as long as it calculates something, displays something, or otherwise has an output that benefits the user, it is a program. It could be a program that makes a random number, or a program that tells the user a joke from a database.


Using a computer how do you create a program that calculates the circumference and area of a circle?

a circle has an area of 36pie square centimeters what is the circumference ?


What does the computer program Md5sum do?

Md5sum is a program that verifies and calculates 128-bit MD5 hashes. The MD5 checksum is seen as the compact digital fingerprint that is unique to each file.