int num=scn.nextInt();

    int i=1;

    while(i<=num){

        String type;

        if(i%2==0)

        type="even";

        else

        type="odd";

        System.out.println(i + " is " +type );

        i++;

    }

Comments