answersLogoWhite

0


Best Answer

To compute this sum, we can use a nifty algebraic approach:

Let S be the sum, so:

S = 3 + 6 + 9 + 12 + ... + 996 + 999

We can also write S as:

S = 999 + 996 + ... + 12 + 9 + 6 + 3

Adding these two equations together we get:

2S = 1002 + 1002 + ... + 1002 + 1002

Where there are 333 1002's in the above equation.

This leads us to:

2S = 1002 * 333

S = 501 * 333 = 166,833.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: A program that will compute for and display the sum of all numbers divisible by 3 from 1 to 1000?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Other Math

In all how many numbers from 200 to 500 are divisible by all of the following 2 3 4 5 6?

The numbers divisible by all five numbers must be multiples of the LCM (LCD) of the numbers, which is 22 x 3 x 5 = 60. There are 5 numbers: 240, 300, 360, 420, and 480. --- There is also a C program that can be used to find these: #include <stdio.h> void main() { for (int i=200;i<=500;++i) if (!((i%6)(i%4)(i%5)(i%3)(i%2))) printf("%d ",i); printf("\n"); }


C program to print all integers between 1 to 100 not divisible by 2 or 3?

#include<stdio.h> #include<conio.h> void main() { clrscr(); for (int i=1;i<=100;i++) { if(i%2 !=0 && i%3 !=0) { printf("\n Numbers that are not divisible by 2 or 3:%d \n ",i); } printf("\n"); } getch(); }


C program to find numbers divisible by 7?

#include<stdio.h> #include<conio.h> void main() { int i,c,n; printf("Enter the number of terms you want which are divisible by 7"); scanf("%d",&n); c=0; for(i=7;;i+=7) { printf("\n %d ",i); c++; if(c==n) break; } getch(); }


Write a program which takes any number of days from the user the program should display the number of years number of months formed by these days as well as the remaining days?

Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.


Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html

Related questions

What BASIC program can compute and display all prime numbers from 1 to 40?

PRINT 2,3,5,7,11,13,17,19,23,29,31,37


Design and develop a simple application program that will compute the sum of two numbers?

This isn't a question!


What Program that will display the even numbers in data structures and algorithms?

JAVA


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


Write a program to compute the sum of first ten integer numbers in PHP?

$n = 10*(1+10)/2;


How do you write a C plus plus program that will display the first 10 positive prime numbers?

By learning how to program on C+.


C program to generate numbers from 1 to 100 divisible by 2?

(rand()&50+1)*2


Program for print prime all number from 1 to 100 in foxpro?

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.


Make a program that will accept any number n between 20-50 and another number x between 1-5 Then the program will display all numbers from 1-n that is divisible by x?

/* a number divisible by x should be a multiple of x */ int i, n,x; scanf ("%d", &n); scanf ("%d",&x); for(i=x;i =< n;i+=x) { printf ("%d", x); }


Write the full program for the quadratic equation in COBOL?

Identification division. Program-id. Quadratic. Environment division. Data division. Working-storage section. 01 a pic 9(3) value 0. 01 b pic 9(3) value 0. 01 c pic 9(3) value 0. 01 d pic 9(3) value 0. 01 e pic 9(3) value 0. 01 f pic 9(3) value 0. 01 g pic 9(3) value 0. 01 h pic 9(3) value 0. 01 x1 pic 9(3) value 0. 01 x pic z(3).z(2) value 0. 01 x2 pic 9(3) value 0. 01 y pic z(3).z(2) value 0. Procedure division. Display "Written by Martin O. Egua, but not complete". Display "Quadratic equation solver for three values a, b & c" Display "Enter a number: " Accept a. Display "Enter the second number: " Accept b. Display "Enter the last number: " Accept c. compute d = (b * b) compute e = 4 * a * c compute f = 2 * a compute g = d - e compute h = function sqrt (g). compute x1 = (-b) + h compute x = x1 / f Display "X = " x compute x2 = (-b) - h compute y = x2 / f Display "Y = " y Display "Send the accurate program". Stop run.


Can you give me a program that will compute number 1 to 5?

nr\m;laeoh9y0m g.qthnedxc In fortran: do i=1,5 write(6,*)i enddo stop end This program will write the numbers 1 to 5 on the screen.


How do you write a Qbasic program to display these Numbers-0112358132134?

you do this 10 print "0112358132134" use the whole of the thing