Search found 1 match

by Mirfat Akter Sharmin
Sat Aug 27, 2005 7:14 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 51378

WHY WRONG???371

Why this is getting wrong answer??It is giving output correctly..Plz help...


#include<stdio.h>

int maxlength(long int n){
int len = 0;
while(n>1){
if(n%2==0){
n/=2;
len++;
}
else{
n = 3*n +1;
len++;
}
}
return len;
}
void main(){
long int i,k,in1,in2,temp;
int max ,length;
while ...

Go to advanced search