Posts

Showing posts from July, 2022

Hackerank if else problem with solution --23/7/2022

Task Given an integer,  , perform the following conditional actions: If   is odd, print  Weird If   is even and in the inclusive range of   to  , print  Not Weird If   is even and in the inclusive range of   to  , print  Weird If   is even and greater than  , print  Not Weird import   java . io .*; import   java . util . Scanner ; public   class   Solution   {      public   static   void   main ( String []   args )   {          Scanner   sc   =   new   Scanner ( System . in );           int   n   =   sc . nextInt ();           int   to_check   =   n % 2 ;           if ( to_check != 0 ){   ...