wrong answer to test

#include<iostream.h>

void main()

{ int a;

while(1)

{ cin>>a;

if(a!=42&&a<100&&a>0)

cout<<a<<"\n";

else

break;}

}
this is my code…it works fine on my turbo and on codechef it shows compilation error if i select C++ as language and wrong answer when i choose pure text as language.

ALSO PLEASE TELL ME A STANDARD C++ COMPILER WHERE I CAN EXEUTE MY CODES

Dev c++ and ms visual c++ are standard compilers. There are a few problems which i’d like to point out.

1.) Use iostream instead of iostream.h
2.) add “using namespace std;” below the iostream line
3.) use int main () instead of void main () and finally a return 0 in the last line of your code. Some compilers will give u a warning which says tht the main function should return an int value. Rest is fine