View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12890 Members
Join this group to post and comment.

Program for Ramanujan Numbers?

what is wrong in the following code 

output:- 1729 4101 4913 {correct output 1729 4104}

#include

int main(){

int i,d=0,j,k,s=5000;

for(i=1;i<=s;i++){

  for(j=1;j

      for(k=1;k

                if((j*j*j)+(k*k*k)==i&&k>j)

       d++;

                   }

}

if(d==2)

        printf("%d\n",i);

  d=0;

  }

}

Share this content on your social channels -