Findryan

Untitled

Nov 11th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class PerulanganDoWhile
  4. {
  5. public static void main(String[] args)
  6. {
  7. Scanner dataAngka = new Scanner(System.in);
  8. int i=1;
  9. System.out.print("Masukan nilai a = ");
  10. int a = dataAngka.nextInt();
  11. System.out.print("Masukan nilai n= ");
  12. int n = dataAngka.nextInt();
  13. int m =n;
  14. do
  15. {
  16. System.out.println("hasil : "+i);
  17. i=i*a;
  18. i=n+1;
  19. n++;
  20. }
  21. while (i<=m);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment