Search Placementyogi.com
 

Command Line Arguments in C objective questions and Answers

  :: Topics ::

1

In the following program what is the meaning of argc and argv?(select two)

#include<stdio.h>
int main(int argc,char *argv[])
{
  //Some statement
}
A.

argc : count of arguments

B.

argc : vector(array) of arguments

C.

argv : count of arguments

D.

argv : vector(array) of arguments

See Answer & Explanation Lets Discuss
Correct answer is : A,D
Explanation

No explanation available. Let's Discuss

 
2

What will be the output of the program (myprogram.c) given below if it is executed from the command line?

>gcc myprogram.c -o myprogram
>./myprogram 1 2 three four 5.5
#include<stdio.h>
#include<stdio.h>
int main(int argc, char **argv)
{
    int i;
    for(i=0; i<argc; i++)
        printf("%s\t", argv[i]);
}
A.

1 2 three four 5.5

B.

./myprogram 1 2 three four 5

C.

./myprogram 1 2 three four 5.5

D.

./myprogram 1 2 three four

See Answer & Explanation Lets Discuss
Correct answer is : C
Explanation

No explanation available. Let's Discuss

 
 

Banner to LogicGuns.com

Hide Page Information

C Command Line Arguments Objective Questions and Answers for Written Round Interview

Here you can find C Command Line Arguments Objective Questions with answers and explanation. We have a vast collection of Objective Questions on Command Line Arguments in C that will help you a lot!

Why learn C Command Line Arguments?

Command Line Arguments are an integral part of C and many Objective Questions in the written round are asked from this topic.In this section you can learn and practice C Command Line Arguments (Objective Questions with Answers) to improve your skills in order to face the interview and clear campus and off-campus selection of TCS, Infosys, Wipro etc.

Where can I get C Command Line Arguments Objective Questions and Answers with Explanation?

PlacementYogi provides you lots of fully solved C Command Line Arguments Objective Questions and answers with explanation. Fully solved examples with detailed answer description, explanation are given and it would be easy to understand.Though we do not have pdf file for C Command Line Arguments, We have quiz Objective Questions with answers to help you test yourself..

\n

Where can I get C Command Line Arguments Interview Objective Questions and Answers (objective type, multiple choice)?

Here you can find objective type C Command Line Arguments Objective Questions and answers for interview and entrance examination.Multiple Answers and true or false type Objective Questions are also provided.

How to solve C Command Line Arguments problems?

You can easily solve all kind of Objective Questions based on C Command Line Arguments by practicing the exercises (including shortcut Command Line Arguments to solve problems) given below.