Can I use turbo c++

I am submitting the solution as text file. Compiling it on Turbo c++
Are the inputs provided to the program as they have written it ?
means that and if I have something like
enter first
enter second

etc etc, will it not work ?

The correctness of your program is checked by running your program on some test input files and checking
its output against the expected output. So, you should not make your program interactive like
asking the user to input first number and so on. You can comment out such print statements before submitting.

Aside from your question, I think its preferable to use a gcc based compiler, like MinGW by installing
Codeblocks OR DevCpp instead of Turbo-C++.

CodeChef does not say that you can not use turbo c++ or You should use DEV C++ or GNU compiler. Codechef suggest that you can try these compiler.

Now if we are talking about correctness of the problem then its totally depend on your algorithm its does not depend on your compiler that if you use DEV compiler then your program is correct other than its incorrect.

But Codechef decides some of the guide lines for the program which you have to follow, these are:

1: Never use void main(), a new programmer who are using turbo, they did this mistake. you should use int main() and write return statement in last of the program. and always use “return 0;” because 0 represent successful completion of the program. if you are using other than zero then you will suffer from runtime error.

2: Never write statement like printf(“enter the no and all”); You use printf only for output of the program. and use scanf, only input form the program.

3: and output formate should match the given output format. even a single space not allowed. like if you have to give output in the form 10:10:10 then you should use printf statement like :


Not like:

printf("%d : %d : %d",a,b,c);

printf("%d:%d:%d ",a,b,c);

These are the main guideline where maximum of the newbe makes a mistake.

And off course you can use any of the compiler but if you are using DEV of GNU compiler then its best.

very good question

Yes, obviously Its not neccessary to use DevCpp or Gcc but its preferable as I mentioned in my post :slight_smile: