//Generate 10 Numbers and display the length of longest increasing order
class P2
{
public static void main(String args[])
{
int inputnum=0,prevnum=0,counter=0,hcounter=0;
System.out.print("Random Numbers generated are: ");
for(int i=1;i<=10;i++)
{
inputnum=(int)(Math.random()*100);
System.out.print(""+inputnum+", ");
if(inputnum >= prevnum)
{
counter++;
if(counter>hcounter)
{
hcounter=counter;
}
}
else
{
counter=1;
}
prevnum=inputnum;
}
System.out.print("\nLength of longest increasing series is: "+(hcounter));
}
}
class P2
{
public static void main(String args[])
{
int inputnum=0,prevnum=0,counter=0,hcounter=0;
System.out.print("Random Numbers generated are: ");
for(int i=1;i<=10;i++)
{
inputnum=(int)(Math.random()*100);
System.out.print(""+inputnum+", ");
if(inputnum >= prevnum)
{
counter++;
if(counter>hcounter)
{
hcounter=counter;
}
}
else
{
counter=1;
}
prevnum=inputnum;
}
System.out.print("\nLength of longest increasing series is: "+(hcounter));
}
}