Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. int i= 0, x=0 ;
  2. double a= 3.14,z;
  3. // int jawab;
  4. // System.out.print("Masukkan banyaknya deret");
  5. // jawab = scan.nextInt();
  6.  
  7. System.out.print("x = ");
  8. for(int k=1; k<=10;k++){
  9. if (((++i % 2) == 1) && (i<20)){
  10. // System.out.println();
  11. z = a*i;
  12. System.out.print(z+" ");
  13. // System.out.print(a + " + ");
  14.  
  15. // x += i;
  16. }
  17. else if (i==20) {
  18. System.out.print(i);
  19. x += i;}
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement