Write a program in Java to display first 10 odd numbers starting with 51.
Answers
Answered by
1
Answer:
In this example, we will write a Java program to display odd numbers from 1 to n which means if the value of n is 100 then the program will display the odd numbers between 1 and 100.
Program to print odd numbers from 1 to n where n is 100
In the following example we have provided the value of n as 100 so the program will print the odd numbers from 1 to 100.
The logic we are using in this program is that we are looping through integer values from 1 to n using for loop and we are checking each value whether the value%2 !=0 which means it is an odd number and we are displaying it. To understand this program, you should have the basic knowledge of for loop and if statement.
Answered by
0
Answer:
I am also looking for this answer
Similar questions
Geography,
2 months ago
Social Sciences,
2 months ago
Math,
6 months ago
English,
6 months ago
Math,
11 months ago
Math,
11 months ago
Social Sciences,
11 months ago