TCS NQT Command Line Arguments Quiz– 1

Question 1

Time: 00:00:00
Which of the following syntax is correct for command-line arguments ?

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

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

int main(char *arv[], int arg)

int main(char *arv[], int arg)

int main(char c,int v)

int main(char c,int v)

int main(int v,char c)

int main(int v,char c)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
What does argv and argc indicate in ?

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

argument constant, argument variable

argument constant, argument variable

argument count, argument vector

argument count, argument vector

argument constant, argument vector

argument constant, argument vector

argument count, argument variable

argument count, argument variable

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
What argv means in command line argument ?

Array of pointers

Array of pointers

pointer to a character array

pointer to a character array

Array of character pointers

Array of character pointers

Array of Strings

Array of Strings

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
What is the first argument of command line ?

The number of command-line arguments the program was invoked with

The number of command-line arguments the program was invoked with

Program Designation

Program Designation

A pointer to an array of character strings that contain the arguments

A pointer to an array of character strings that contain the arguments

Nothing

Nothing

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Which one of these is equivalent to argc ?

Number of Arguments

Number of Arguments

Number of Arguments – 1

Number of Arguments – 1

Number of Arguments + 2

Number of Arguments + 2

Number of Arguments + 1

Number of Arguments + 1

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
What type of array is generally generated in Command-line argument ?

MultiDimensional Array

MultiDimensional Array

Jagged Array

Jagged Array

2-Dimensional Array

2-Dimensional Array

Single Dimensional Array

Single Dimensional Array

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
The maximum length of the command-line arguments including the spaces is ?

May vary from one OS to another

May vary from one OS to another

256 characters

256 characters

Depends on the Number of arguments

Depends on the Number of arguments

128 characters

128 characters

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
The index of the last argument in command line arguments is ?

argc

argc

argc * 2

argc * 2

argc – 1

argc – 1

argc +1

argc +1

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
What argv[0] and argv[1] denote in Command line Arguments ?

Pointers to first two command line argument supplied.

Pointers to first two command line argument supplied.

The name by which the program was invoked and Pointer to the 1st argument.

The name by which the program was invoked and Pointer to the 1st argument.

Count of the arguments in argv[] vector and pointer to first command line argument supplied.

Count of the arguments in argv[] vector and pointer to first command line argument supplied.

None of these.

None of these.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
What will be the output of the following program if argument passed to command lines are : prog 1 4 2

#include<stdio.h>
int main (int argc, char *argv[])
{
int j;
j = argv[1] + argv[2] - argv[3];
printf("%d", j);
return 0;
}

Error

Error

3

3

Garbage Value

Garbage Value

None of these

None of these

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]


Buy TCS NQT Paid Materials

Paid Materials TCS NQT

Join TCS NQT Online Classes

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/13

Accuracy

0%

Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects

Comments