"Your program has not solved the problem. It ran during 0.002 seconds."
#include<stdio.h>
#include<stdlib.h>
int function(int k);
int count;
void main()
{
int m,n,i,temp,maxCount,tempCount;
scanf("%d %d",&n,&m);
if(n>m)
{
temp=n;
n=m;
m=temp;
}
maxCount=function(n);
for(i=n+1;i<=m;i++)
{
tempCount=function(i);
if(maxCount<tempCount)
{ temp=tempCount;
tempCount=maxCount;
maxCount=temp;
}
}
printf("\n %d %d %d",n,m,maxCount);
}
int function(int k)
{ count=1;
while(k!=1)
{ count++;
if((k%2)==0)
k=k/2;
else
k=3*k+1;
}
return count;
}
But compiler in my pc giving the required result.
so, What's the problem in it??????
