Skip to content
Advertisement

Tag: while-loop

to limit the limit count variable to fixed value

I want to execute some code based on value in limit count, but I want to limit its value to 20000 max. for eg if limit count passed is 50000 then run the code three times with values as 20000,20000,10000 also if limit count is 10000 then run it as is Answer I guess, you need smth like that:

How to find max number and occurrences

So I’m learn java for the first time and can’t seem to figure how to set up a while loop properly . my assignment is Write a program that reads integers, finds the largest of them, and counts its occurrences. But I have 2 problems and some handicaps. I’m not allowed to use an array or list because we haven’t

Advertisement