Write a program to implement basic data types and control structure (loop, if-else etc ) in java.
Program Code:
public class Test
{
public static void main(String args[])
{
for(int x = 1; x < 10; x = x+1)
{
System.out.print("value of x : " + x );
System.out.print("\n");
}
}
}
Output:
value of x 1
value of x :2
value of x :3
value of x:4
value of x :5
value of x:6
value of x :7
value of x :8
value of x:9
value of x:10
Thanks
Mukesh Rajput
Post A Comment:
0 comments: