Sunday, 12 January 2020

HAY THANK FOR VISIT


Question:-Write a program  to print a sreing array and print the largest.

class lar
{
    void main(String s[])
    {
        int l=0;
       String lar=s[0];
       for(int i=1;i<s.length;i++)
       {
           l=s[i].length();
           if(l>lar.length())
           {
               lar=s[i];
            }
        }
        System.out.println("longest string is"+lar);
    }

}

No comments:

Post a Comment

HAY THAKYOU FOE VISIT

Program(python):-Find duplicates in an array (Geeks for geek problem)

QUESTION:- Given an array  a  of size  N  which contains elements from  0  to  N-1 , you need to find all the elements occurring more than o...