Monday 8 September 2008

C Command line argument questions with solution




Command line arguments in c example 



(1)What will be output of
following c code?




#include

int main(int count,char *argv[]){

    int i=0;

    for(i=0;i
         printf("\n%s",argv[i]);

    return 0;

}



//save file as arg.c

In command line

C:\tc\bin>arg c question bank

Output:

c

question

bank








(2) What will be output of
following c code?



#

No comments:

Post a Comment