Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Java
public class LengthOfLongsSerise {
    public static void main(String[] args) {

        int a ;
        int cnt1 = 0;
        int cnt2 = 0;
        int cnt3 = 0;
        int cnt4 = 0;
        a=(int)(Math.random()*100);
        int j=0;
        int p=55;
        for(int i=1;i<=10;i++){
         j=a=(int)(Math.random()*100);
        j++;
      System.out.println(j);
        }
      }

int this care if auto generate numbers(4,5,6,2,8,12,14,16,5,9)then here is three serise
like = 1st- 4,5,6
second-2,8,12,14,16
3rd- -5,9
i want this out put is second is max serise length outputis only =4


.Help me plz .
Posted
Updated 30-May-12 22:32pm
v3
Comments
Sergey Alexandrovich Kryukov 30-May-12 20:19pm    
Huh? Serise..?! Please spell-check it -- hard to understand what are you talking about.
--SA
kushal.choudhary 30-May-12 20:29pm    
series (EXAMPLE = LIKE MISSION IMPOSSIBLE MOVIE SERIES)

in this program
1st =4,5,6
2ns = 2,8,12,14,16
3rd = 5,9 GOT IT SIR..??
Sandeep Mewara 31-May-12 1:14am    
Homework?

1 solution

Something like:
count = 3
for (i = 1; i <= count; ++i)
{
    print "series ", i, ": "
    lastNumber = 0
    while (true)
    {
        number = Random()
        if (number > lastNumber)
        {
            print number, ", "
            lastNumber = number
        }
        else
        {
            print "\n"
            break;
        }
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900