Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the syntax for constant pointer to address (i.e., fixed pointer address)?(a) const * (b) * const (c) const * (d) none of the mentionedThis question was posed to me in an interview.I need to ask this question from Character Pointers and Functions in section Pointers and Arrays in C of C

Answer»

The correct ANSWER is (B) * const

For EXPLANATION: None.

2.

What is the second argument in command line arguments?(a) The number of command-line arguments the program was invoked with;(b) A pointer to an array of character strings that contain the arguments, one per string(c) Nothing(d) None of the mentionedI have been asked this question in examination.This question is from Command Line Arguments in portion Pointers and Arrays in C of C

Answer» CORRECT answer is (b) A POINTER to an ARRAY of CHARACTER strings that contain the arguments, one per string

The EXPLANATION is: None.
3.

Arguments that take input by user before running a program are called?(a) Main function arguments(b) Main arguments(c) Command-Line arguments(d) Parameterized argumentsThe question was posed to me in semester exam.I'm obligated to ask this question of Pointers and Function Arguments topic in division Pointers and Arrays in C of C

Answer»

Right CHOICE is (C) Command-Line arguments

To EXPLAIN I would say: NONE.

4.

Which type of variables can have the same name in a different function?(a) Global variables(b) Static variables(c) Function arguments(d) Both static variables and Function argumentsThis question was addressed to me by my college director while I was bunking the class.Enquiry is from Pointers and Function Arguments in chapter Pointers and Arrays in C of C

Answer»

Correct option is (d) Both STATIC VARIABLES and FUNCTION arguments

The explanation: NONE.

5.

What is the first argument in command line arguments?(a) The number of command-line arguments the program was invoked with;(b) A pointer to an array of character strings that contain the arguments(c) Nothing(d) None of the mentionedThis question was addressed to me in homework.My doubt is from Command Line Arguments topic in portion Pointers and Arrays in C of C

Answer» RIGHT answer is (a) The number of command-line arguments the PROGRAM was INVOKED with;

For explanation: NONE.
6.

Which is true for a, if a is defined as “int a[10][20];”?(a) a is true two-dimensional array(b) 200 int-sized locations have been set aside(c) The conventional rectangular subscript calculation 20 * row+ col is used to find the element a[row, col].(d) All of the mentionedI got this question during an internship interview.I want to ask this question from Pointers Vs. Multi-dimensional Arrays in chapter Pointers and Arrays in C of C

Answer»

The CORRECT ANSWER is (d) All of the mentioned

Easy EXPLANATION - NONE.

7.

What is the size of *ptr in a 32-bit machine (Assuming initialization as int *ptr = 10;)?(a) 1(b) 2(c) 4(d) 8This question was addressed to me in an internship interview.Query is from Address Arithmetic in chapter Pointers and Arrays in C of C

Answer» RIGHT OPTION is (C) 4

The EXPLANATION is: NONE.
8.

How to call a function without using the function name to send parameters?(a) typedefs(b) Function pointer(c) Both typedefs and Function pointer(d) None of the mentionedI got this question in exam.The doubt is from Pointers to Functions in division Pointers and Arrays in C of C

Answer»

The CORRECT choice is (B) FUNCTION pointer

For EXPLANATION: None.

9.

Which of the following is a correct syntax to pass a Function Pointer as an argument?(a) void pass(int (*fptr)(int, float, char)){}(b) void pass(*fptr(int, float, char)){}(c) void pass(int (*fptr)){}(d) void pass(*fptr){}I had been asked this question in my homework.I want to ask this question from Pointers to Functions in division Pointers and Arrays in C of C

Answer» RIGHT answer is (a) void pass(int (*FPTR)(int, FLOAT, CHAR)){}

The best explanation: None.
10.

What is the advantage of a multidimensional array over pointer array?(a) Predefined size(b) Input can be taken from user(c) Faster Access(d) All of the mentionedThe question was asked in an online quiz.I would like to ask this question from Pointers Vs. Multi-dimensional Arrays topic in portion Pointers and Arrays in C of C

Answer» CORRECT OPTION is (d) All of the mentioned

The BEST I can EXPLAIN: NONE.
11.

In linux, argv[0] by command-line argument can be occupied by _________(a) ./a.out(b) ./test(c) ./fun.out.out(d) all of the mentionedI have been asked this question in quiz.The origin of the question is Command Line Arguments in section Pointers and Arrays in C of C

Answer»

Correct answer is (d) all of the MENTIONED

Easy explanation - All the options mentioned (./a.out, ./test, ./fun.out.out) are simply the command WITHOUT any argument. A command is ALWAYS stored as argument vector zero i.e., argv[0] always contain the command where as argv[1], argv[2], etc. CONTAINS the arguments to the commands, if any.

12.

A program that has no command line arguments will have argc _________(a) Zero(b) Negative(c) One(d) TwoThis question was addressed to me in an internship interview.I'm obligated to ask this question of Command Line Arguments in division Pointers and Arrays in C of C

Answer» RIGHT CHOICE is (C) One

For EXPLANATION: NONE.
13.

What is the correct syntax to send a 3-dimensional array as a parameter? (Assuming declaration int a[5][4][3];)(a) func(a);(b) func(&a);(c) func(*a);(d) func(**a);The question was posed to me during a job interview.This is a very interesting question from Multidimensional Arrays topic in section Pointers and Arrays in C of C

Answer» RIGHT CHOICE is (a) FUNC(a);

The EXPLANATION: NONE.
14.

Which of the following can never be sent by call-by-value?(a) Variable(b) Array(c) Structures(d) Both Array and StructuresI have been asked this question in an interview.I'm obligated to ask this question of Pointers and Function Arguments topic in chapter Pointers and Arrays in C of C

Answer» CORRECT OPTION is (B) Array

Explanation: NONE.
15.

Which is an indirection operator among the following?(a) &(b) *(c) ->(d) .The question was posed to me during an interview.The doubt is from Pointers and Addresses in chapter Pointers and Arrays in C of C

Answer» CORRECT OPTION is (B) *

EXPLANATION: NONE.
16.

What type of array is generally generated in Command-line argument?(a) Single dimension array(b) 2-Dimensional Square Array(c) Jagged Array(d) 2-Dimensional Rectangular ArrayThis question was addressed to me in an internship interview.My question is taken from Command Line Arguments in section Pointers and Arrays in C of C

Answer» CORRECT OPTION is (c) JAGGED Array

Easy EXPLANATION - None.
17.

An array of similar data types which themselves are a collection of dissimilar data type are ___________(a) Linked Lists(b) Trees(c) Array of Structure(d) All of the mentionedThe question was asked in my homework.The query is from Pointers and Arrays topic in chapter Pointers and Arrays in C of C

Answer»

Right ANSWER is (c) ARRAY of Structure

To explain: NONE.

18.

What type of initialization is needed for the segment “ptr[3] = ‘3’;” to work?(a) char *ptr = “Hello!”;(b) char ptr[] = “Hello!”;(c) both char *ptr = “Hello!”; and char ptr[] = “Hello!”;(d) none of the mentionedThis question was posed to me in examination.The origin of the question is Character Pointers and Functions in portion Pointers and Arrays in C of C

Answer»

The correct choice is (B) char PTR[] = “Hello!”;

The EXPLANATION: NONE.