answersLogoWhite

0

public class TestBB {

/**

* @param args

*/

public static void main(String[] args) {

int sum = 0;

int i = 0;

do {

sum = sum + i;

i++;

} while (i <= 100);

System.out.println("Total of 100 numbers is: " + sum);

}

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Which culture was the first to use integers?

The concept of integers, including positive and negative whole numbers, originated in ancient Mesopotamia around 3000 BCE. The Sumerians developed a system of counting using tokens to represent quantities, which eventually evolved into a written numerical system using cuneiform symbols. These early civilizations laid the foundation for the development of integers as a fundamental mathematical concept.


How do you you Create 2 text-field and 1 button in java using applet and then get the input as integers in 2 text-field and to display the output in label already created when you click the button?

How to you Create 2 text-field and 1 button in java using applet and then get the input as integers in 2 text-field and to display the output in label already created when you click the button? please send immediately,needed urgently


What is the sum of the first forty positive integers?

The sum of the first forty positive integers can be calculated using the formula for the sum of an arithmetic series, which is (n/2)(first term + last term) where n is the number of terms. In this case, the sum is (40/2)(1 + 40) = 820.


How are integers used in skateboarding?

integers are used in skateboarding by using positive integers like 180 360 540 720 and 900


Who was the first lady to begin using the china room to display the pieces of china?

the get nasty booty scracher


What is the sum of the first 1000 positive integers?

Using Gauss's method, 1+2+3...1000= 500x1001=500500 Answer:500500


How can I effectively display my pictures using wall magnets?

To effectively display pictures using wall magnets, first choose a suitable wall space. Then, attach the magnets to the back of your pictures and position them on the wall in a visually appealing arrangement. Adjust the placement as needed until you are satisfied with the display.


What is the sum of the 10 positive integers?

The sum of the first 10 positive integers, using the formula N1 + (N1 + 1) + ... + N2 = N2 * (N2 + 1) / 2 - (N1 - 1) * N1 / 2 is: 55


What are 3 consecutive integers whose sum is 81?

The integers are 26, 27 and 28. Using just oddconsecutive integers you have 25, 27 and 29.


What is a profit of 27 using integers?

The profit of 27 using an integer is 12


What are three consecutive integers such that the sum of five times the first six times the second and seven times the third is 148?

This doesn't work for integers. Using 7, 8 and 9 comes up with 146 which is the closest you can get.


How can you find the distance between two integers using the difference?

To find the distance between two integers using the difference, you simply subtract the smaller integer from the larger integer. The result will be the distance between the two integers on the number line. For example, if you have integers 7 and 3, you would subtract 3 from 7 to get a distance of 4. This method works because the difference between two integers gives you the number of units separating them on the number line.