Google Translate

percabangan For dalam Java

Pernyataan for adalah cara praktis untuk melakukan perulangan. Bentuk umumnya sebagai berikut:
for (initialization; termination; iteration) body;


Coding:
class forDemo {
public static void main(String args[]) {
for (int i = 1; i <= 10; i++)
System.out.print(i + " ");
}
}


Bila dieksekusi akan menghasilkan:
1 2 3 4 5 6 7 8 9 10
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© ILMU TEKNIK INFORMATIKA
Designed by BlogThietKe Cooperated with Duy Pham
Released under Creative Commons 3.0 CC BY-NC 3.0
Posts RSSComments RSS
Back to top