Advertisement
Md_hosen_zisad

using loop

Feb 26th, 2018
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.25 KB | None | 0 0
  1. package pucc;
  2.  
  3. public class test {
  4.  
  5.     public static void main(String[] args) {
  6.         int sum=0;
  7.         for(int i=0;i<=5;i++)
  8.         {
  9.            sum+=i;
  10.            System.out.println("the current value of i is"+i);  }
  11.         System.out.println(sum);
  12.        
  13.     }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement