Command Line Arguments

Q1: If the following program (myproc.c) is present in the directory 'C:\TC' then what will be output of the program if run it from DOS shell?
/* myproc.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf('%s', argv[0]);
    return 0;
}

A SAMPLE.C

B C:\TC\MYPROC.EXE

C C:\TC

D Error

ANS:A - SAMPLE.C

In order to execute it from DOS shell, we have to run the created EXE file by entering the exe file name as C:\TC>myproc <enter>.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.