import java.util.*;
class EvenNumAlter
{
public static void main(String[] args)
{
int n,count=0;
Scanner sn=new Scanner(System.in);
System.out.println("Enter The Number::");
n=sn.nextInt();
for(int i=1;i<=n;i++)
{
if(i%2==0)
{
count=count+1;
if(count%2!=0)
System.out.println(i);
}
}
}
}
No comments:
Post a Comment