[Solved] SPOJ – Life, the Universe, and Everything


Two mistakes:

  1. Remove this line- printf("Input:- \n");
  2. In question you have to print before coming 42. If 42 has come you have to break.

Like this:

if(n!=42) 
   printf("%d\n",n); 
else 
   break;

solved SPOJ – Life, the Universe, and Everything