Live Help (Start Chat)
View Count: 0
Duration: 9 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 10 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Question No: 1 of 15
How to declare main when it receives command-line arguments? 
Options:
  1. int main(int argc, char *argv[])
  2. int main(argc, argv)
  3. int main() { int argc; char *argv; }
  4. None of Above
View Answer/Explanation:
a
Explanation:

Question No: 2 of 15
What is meant by the 'c' and 'v' in argv? 
Options:
  1. 'c' means argument count 'v' means argument vector
  2. 'c' means argument control 'v' means argument vector
  3. 'c' means argument count 'v' means argument vertex
  4. None of above
View Answer/Explanation:
a
Explanation:

Question No: 3 of 15
How to write command line arguments if argument has a space? 
Options:
  1. “command line arguments”
  2. % command line arguments %
  3. ‘command line arguments’
  4. & command line arguments
View Answer/Explanation:
a c
Explanation:

Question No: 4 of 15
Even if integer or float type arguments are given at command prompt they are considered as strings. 
Options:
  1. True
  2. False
View Answer/Explanation:
a
Explanation:

Question No: 5 of 15
Which of the following is invalid for the below code?
	int main(int first, char sec){ } 
Options:
  1. first contains count of arguments supplied at command-line
  2. In place of first and sec, argc and argv should be used
  3. sec[] contains addresses of arguments supplied at a command line
  4. None of above
View Answer/Explanation:
c
Explanation:

Question No: 6 of 15
What will be the output of the program (cmd> prog one two three) given below if it is executed from the command line?
	#include
	int main(int argc, char **argv)
	{
   		 printf("%c\n", **argv++);
  		 return 0;
	} 
Options:
  1. prog
  2. prog one
  3. c
  4. compilation error
View Answer/Explanation:
c
Explanation:

Question No: 7 of 15
What will be the output of the program (cmd> trial 1 2 3) given below if it is executed from the command line?
	#include
	int main(int argc, char *argv[])
	{
 		   int i;
 		   i = argv[1] + argv[2] + argv[3];
 		   printf("%d", i);
  		  return 0;
	} 
Options:
  1. 6
  2. Trial 1 2 3
  3. Error
  4. Garbage value
View Answer/Explanation:
c
Explanation:
Explanation:-Here argv[1], argv[2] and argv[3] are string type. We have to convert the string to integer type before perform arithmetic operation. Valid way is as : i = atoi(argv[1]) + atoi(argv[2]) + atoi(argv[3]);

Question No: 8 of 15
argc refers to the Number of arguments passed from the command line arguments 
Options:
  1. True
  2. False
View Answer/Explanation:
a
Explanation:

Question No: 9 of 15
argv() refers to the pointer array which points  to each argument passed to the program. 
Options:
  1. True
  2. False
View Answer/Explanation:
a
Explanation:

Question No: 10 of 15
If no arguments are supplied from command prompt then value of argc() contains 
Options:
  1. One
  2. Zero
  3. -1
  4. Garbage value
View Answer/Explanation:
a
Explanation:

  1