Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

sum of no

public class Demo {
   public static void main(String[] args) {
      int sum = 0;
      int n = 50;
      for (int i = 1; i <= n; i++) {
         sum = sum + i;
      } 
      System.out.println("The Sum Of " + n + "is" + sum);
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: detect bluetooth headphones android programmatically 
Java :: how to display an integer in a textfield in java 
Java :: gson to class 
Java :: reactive kafka 
Java :: close current file android studio shortct 
Java :: What is the use of @Listener annotation in TestNG? 
Java :: Calculator repeat 
Java :: java split not working on comma 
Java :: java convert 2d array to 1d stream 
Java :: change button background drawable in code Close 
Java :: validate list of objects in javax validation 
Java :: cgange background from button click java fx 
Java :: using addition to multiply in java 
Java :: data structure in java 
Java :: public class ForLoop { public static void main(String[] args){ for(int i=1; i=n ;i++ ) System.out.println("i"); } } 
Java :: @exceptionhandler spring boot annotation not found 
Java :: code for working clock in java eclipse 
Java :: javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key 
Java :: split the argument String and add the tokens into a list 
Java :: spigot self cancelling task 
Java :: leetspeak 
Java :: closable resources java 
Java :: android studio bring keyboard up 
Java :: change from one java compiler to another in cmd 
Java :: instance block 
Java :: java resultset.absolute 
Java :: before first in jdbc 
Java :: Write a java program to merge three singly linked list elements 
Java :: firebase timestamp to textview 
Java :: what does put extra do? 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =