Q.1.

If the different command line arguments are supplied at different times would the output of the following program change?

#include<stdio.h>

int main(int argc, char **argv)
{
    printf("%d\n", argv[argc]);
    return}
Q.2.

In Turbo C/C++ under DOS if we want that any wild card characters in the command-line arguments should be appropriately expanded, are we required to make any special provision?

Q.3.

Every time we supply new set of values to the program at command prompt, we need to recompile the program.

Q.4.

Does there exist any way to make the command-line arguments available to other functions without passing them as arguments to the function?

Q.5.

Even if integer/float arguments are supplied at command prompt they are treated as strings.

Q.6.

The first argument to be supplied at command-line must always be count of total arguments.

Q.7.

According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?

Q.8.

The maximum combined length of the command-line arguments including the spaces between adjacent arguments is

Q.9.

What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample "*.c"

/* sample.c */
#include<stdio.h>

int main(int argc, int *argv)
{
    int i;
    for(i=i<argc; i++)
        printf("%s\n", argv[i]);
    return
}
Q.10.

What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample 1 2 3
cmd> sample 2 2 3
cmd> sample 3 2 3

/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf("%s\n", argv[0]);
    return}
Q.11.

What will be the output of the program if it is executed like below?
cmd> sample

/* sample.c */
#include<stdio.h>

int main(int argc, char **argv)
{
    printf("%s\n", argv[argc-1]);
    return
}
Q.12.

What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog 1 2 3

/* myprog.c */
#include<stdio.h>
#include<stdlib.h>

int main(int argc, char **argv)
{
    int i, j=    for(i=i<argc; i++)
        j = j+atoi(argv[i]);
    printf("%d\n", j);
    return}
Q.13.

What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three

/* myprog.c */
#include<stdio.h>
#include<stdlib.h>

int main(int argc, char **argv)
{
    int i;
    for(i=i<=i++)
        printf("%u\n", &argv[i]);
    return}

If the first value printed by the above program iswhat will be the rest of output?

Q.14.

What will be the output of the program in Turbo C?

#include<stdio.h>

int main(int argc, char *argv, char *env[])
{
    int i;
    for(i=i<argc; i++)
        printf("%s\n", env[i]);
    return}
Q.15.

What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three

/* myprog.c */
#include<stdio.h>

int main(int argc, char **argv)
{
    printf("%c\n", **++argv);
    return}
Q.16.

Which of the following is TRUE about argv?

Q.17.

What do the 'c' and 'v' in argv stands for?

Q.18.

What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample friday tuesday sunday

/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf("%c", **++argv);
    return}
Q.19.

What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample friday tuesday sunday

/* sample.c */
#include<stdio.h>

int main(int sizeofargv, char *argv[])
{
    while(sizeofargv)
        printf("%s", argv[--sizeofargv]);
    return}
Q.20.

What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample Jan Feb Mar

/* sample.c */
#include<stdio.h>
#include<dos.h>

int main(int arc, char *arv[])
{
    int i;
    for(i=i<_argc; i++)
        printf("%s ", _argv[i]);
    return}