No products in the cart.

Write a program to find the …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Write a program to find the sum of first 10 even numbers?
  • 2 answers

Sia ? 3 years, 6 months ago

<pre> public class MyClass { public static void main(String args[]) { int total = 0, sum = 0, evenNumber = 2, n = 10; while(total != n){ total++; sum += evenNumber; evenNumber += 2; } System.out.println("Sum Of First 10 Even Number : " + sum); } } </pre>

Your Name 3 years, 6 months ago

public class MyClass { public static void main(String args[]) { int total = 0, sum = 0, evenNumber = 2, n = 10; while(total != n){ total++; sum += evenNumber; evenNumber += 2; } System.out.println("Sum Of First 10 Even Number : " + sum); } }
http://mycbseguide.com/examin8/

Related Questions

Define packages
  • 0 answers
Write a program for swapping two numbers
  • 1 answers
Write a program for swapping two numbers?
  • 0 answers
What is alu
  • 1 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App