Google

Thursday, March 13, 2008

For Loop Java C# VB

For loop is a statement that allow code to be repeatedly execute.
Code will keep on looping in the loop until it reach the condition that break it out.

Java coding is very similar with C# coding...
However both of them are different language...


Java
for(int i=0; i<= 10 ; i++){
System.out.print(i + " ");
}
//output : 0 1 2 3 4 5 6 7 8 9 10


c#
for(int=0; i<=10 ; i++){
Console.write(i + " ");
}
//output : 0 1 2 3 4 5 6 7 8 9 10


VB
dim i as integer
for i = 0 to 10
msgbox(i)
next
//output :"A message box will prompt wif the value of": 0 1 2 3 4 5 6 7 8 9 10

No comments: