Computer Science, asked by bhardwajneetu753, 2 months ago


Write a program in Java to display first 10 odd numbers starting with 51.​

Answers

Answered by piyush433062
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 rkojha51
0

Answer:

I am also looking for this answer

Similar questions