Question:
Solution:
1. take input i, j. let x=i, y=j.
2. Generate the series.
for(a=i; a<=j; a++){
n=a;
count=1;
while(n!=1){
if(n%2==0){
n = n/2;
}
else{
n = 3*n+1;
}
count++;
}
3. find the max count value by
if(maxcount < count){
maxcount=count;
}
he he, ami mone qustion ee bhujhinai
ReplyDelete