[java]
/**
@author:candidjava.com
@description:Program to display Numbers from 1 to N using While Loop
*/
public class displaynumbers {
public static void main(String org[]) {
int i = 1;
int N = 10;// take variable N value is 10
while (i <= N)// condition for print 1 to N values
{
System.out.println(i);
i++;
}
}
}
[/java]