answersLogoWhite

0

The answer is 28 054

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

Writes a c program to find the sum of all integers between 1 and n?

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11


Java code to find the sum in all integer?

The following will sum all integers from 1-100. Adjust according to your needs.int sum = 0;for (int i = 1; i


Write a program that reads an integer between 0 and 1000 and adds all the digits in the integer?

public class Add { public staticvoid main(String[] args) { int value=12; intcount=0; int sum=0; while(count


Write a Java Program that reads a line of integers and then displays each integer and the sum of all the integers Use StringTokenizer class of javautil?

// Get input BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String input = in.readLine(); in.close(); // Parse input int sum = 0; StringTokenizer parser = new StringTokenizer(input); while (parser.hasMoreTokens()) { int currentInt = Integer.parseInt(parser.nextToken()); System.out.println(currentInt); sum += currentInt; } System.out.println("sum = " + sum);


Write an algorithm find out the sum of first n odd numbers?

Algorithm: sum_evenInput: an integer, n, such that n>0Output: the sum of all even integers within the open range (1:n)sum := 0val := 2while (val < n) do{sum := sum + valval := val + 2}return sumNote that you explicitly specified between 1 and n, which literally means both 1 and n should be excluded from the sum. 1 would be excluded anyway since it is not an even number, however if we wish to include n, then use the following algorithm instead:Algorithm: sum_evenInput: an integer, n, such that n>0Output: the sum of all even integers within the half-open range (1:n]sum := 0val := 2while (val

Related Questions