Sporkinator

class forLooping

Oct 30th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. class forLooping
  2. {
  3. public static void main(String[] args)
  4. {
  5. int x = 3;
  6. for (int i = 0; i < 10; i++)
  7. {
  8. System.out.println("Current value of x is " + x + " current value of i is " + i);
  9. x = x + i;
  10. } //end for loop
  11. System.out.println("The final value of x is " + x);
  12. } //end main
  13. } //end class
Advertisement
Add Comment
Please, Sign In to add comment