Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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);
   }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #sum
ADD COMMENT
Topic
Name
1+7 =