Thursday, 26 October 2017

Command Line argument In Turbo C

How to run a program in Turbo C explained with the example


Step1: Type the program and save with the name “Even1.c”


int main(int argc, char *argv[])



        printf("\nEVEN NUMBER\n");

return 0;


Step2: Compile the program by pressing F9

Then it will start linking

Step3: Go to the command prompt (OS shell) by selecting file – DOS/OS Shell

Step4: Pass command line arguments while executing the program


  1. I am not been able to run this program on turboc++

  2. Are you following all steps correctly??

  3. i am not been able to run this program i follow the above steps

    1. It's working. I have checked it lots of time but still if u are facing problem u cam also check in codeblocks. Its much more easier.

    2. During tcs test where we are going to write the command line program and how we are going to execute that.

  4. During TCS Test, You will have to write and execute Your program on TCS's own Compiler. In that compiler you have space to write your code and click on compile/execute. after that it will show you message like"your program has passed test cases".

  5. when i execute this code in turbo c i'm not getting the output desired.if i enter 5 it displays as "illegal command 5".what can we do?


Featured Post

TCS Latest Test Patern ( For On-Campus Drives )

Tata Consultancy Services is software services consulting company whose  headquarter is situated in Mumbai, India. It is the Asia’s larges...