Posts

Number Present in Array or Not ....................

Image
  code:- import java . util . Scanner ; public class present {         static void Available ( int n , int key , int arr []){         for ( int i = 0 ; i < n ; i ++){             if ( arr [ i ]== key ){                     System . out . println ( key + " is present at " +( i + 1 )+ " location " );             }         }     }     static void searching ( int n , int key , int arr []){         for ( int i = 0 ; i < arr . length ; i ++){         if ( arr [ i ]== key ){             Available ( n , key , arr );             break ;         }     }     }     public static void main ( String [] args ){     ...

LeapYear project

Image
code:- import java.util.Scanner; // save this java file with LeapYear.java public class LeapYear {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );             System . out . print ( "Enter any year " );             int n = sc . nextInt ();             if (n % 4 == 0 && n % 100 != 0 || n % 400 == 0 ){                 System . out . println ( "This is leap Year" );             }             else {                 System . out . println ( "Its not a leap year" );             }                           System . out . print ( "Enter the year from where you...