Write a in java program to print natural odd numbers less than hundred using while loop.
Answers
Answered by
4
Using Java for Loop
public class DisplayOddNumbersExample1.
{
public static void main(String args[])
{
int number=100;
System.out.print("List of odd numbers from 1 to "+number+": ");
for (int i=1; i<=number; i++)
{
Similar questions
Social Sciences,
4 months ago
Hindi,
4 months ago
Math,
7 months ago
Chemistry,
7 months ago
English,
1 year ago