write a program to print odd no. from 10 to 1 using While loop in java
Answers
Answered by
2
class Demo
{
public static void main[String arg]
{
int n = 10;
While (n>0)
{
if ( n%2!=0)
System. out.println(n);
else
n--;
}
}
}
{
public static void main[String arg]
{
int n = 10;
While (n>0)
{
if ( n%2!=0)
System. out.println(n);
else
n--;
}
}
}
garvit1294:
what wrong
Answered by
2
class ODD
{
public static void main()
{
int n=10;
while(n>0)
{
if(n%2==1)
System.out.println(n);
n--;
}
}
}
HOPE IT HELPS!
:)
pls mark it as BRAINLIEST
:D
{
public static void main()
{
int n=10;
while(n>0)
{
if(n%2==1)
System.out.println(n);
n--;
}
}
}
HOPE IT HELPS!
:)
pls mark it as BRAINLIEST
:D
Similar questions