C/C /C programming language MCQ Questions Set 4 Sample Test,Sample questions

Question:
A void pointer cannot point to which of these?

1.methods in c++

2.class member in c++

3.methods & class member in c++

4.none of the mentioned


Question:
 The if..else statement can be replaced by which operator?

1.Bitwise operator

2.Conditional operator

3.Multiplicative operator

4.Addition operator


Question:
 What we can’t do on a void pointer?

1.pointer arithmetic

2. pointer functions

3.pointer objects

4.pointer functions & objects


Question:
 Which is more effective while calling the functions?

1.call by value

2.call by reference

3.call by pointer

4.call by object


Question:
 Which of the following operator is used while declaring references?

1.*

2. &

3.^

4.->


Question:
How a reference is different from a pointer?

1.A reference cannot be null

2.A reference once established cannot be changed

3.The reference doesn’t need an explicit dereferencing mechanism

4.All of the mentioned


Question:
How many can max number of arguments present in function in the c99 compiler?

1.99

2.90

3.102

4.127


Question:
How to declare a wide character in the string literal?

1.L prefix

2. l prefix

3.W prefix

4.Z prefix


Question:
Identify the correct sentence regarding inequality between reference and pointer.

1.we can not create the array of reference

2.we can create the Array of reference

3.we can use reference to reference

4.we can use variable


Question:
Identify the incorrect statement.

1.Reference is the alternate name of the object

2.A reference value once defined can be reassigned

3.A reference value once defined cannot be reassigned

4.Reference is the alternate name of the variable


Question:
Which of the following statement is not true about preprocessor directives?

1.These are lines read and processed by the preprocessor

2.They do not produce any code by themselves

3.These must be written on their own line

4.They end with a semicolon


Question:
Pick the correct statement about references in C++.

1.References stores the address of variables

2.References and variables both have the same address

3.References use dereferencing operator(*) to access the value of variable its referencing

4.References were also available in C


Question:
Pick the correct statement about references.

1.References can be assigned value NULL

2. References once assigned cannot be changed to refer another variable

3.Reference should not be initialized when created

4.Reference is the same as pointers


Question:
Regarding the following statement which of the statements is true?   const int a = 100;

1.Declares a variable a with 100 as its initial value

2.Declares a construction a with 100 as its initial value

3.Declares a constant a whose value will be 100

4. Constructs an integer type variable with an as identifier and 100 as the value


Question:
The data elements in the structure are also known as what?

1.objects

2.members

3.data

4. objects & data


Question:
The declaration of the structure is also called as?

1. structure creator

2.structure signifier

3.structure specifier

4.structure creator & signifier


Question:
The difference between x and ‘x’ is?

1.The first one refers to a variable whose identifier is x and the second one refers to the character constant x

2.The first one is a character constant x and the second one is the string literal x

3.Both are same

4.Both are string literal


Question:
The pointer can point to any variable that is not declared with which of these?

1.const

2.volatile

3.both const & volatile

4. static


Question:
The switch statement is also called as?

1. choosing structure

2.selective structure

3.certain structure

4.bitwise structure


Question:
The void pointer can point to which type of objects?

1. int

2.float

3.double

4.all of the mentioned


Question:
What are mandatory parts in the function declaration?

1.return type, function name

2.return type, function name, parameters

3.parameters, function name

4. parameters, variables


Question:
What are the references in C++?

1.An alternative name for already existing variables

2.A pointer to a variable

3.A new type of variables

4. A new type of constant variable


Question:
What does a reference provide?

1.Alternate name for the class

2.Alternate name for the variable

3.Alternate name for the pointer

4. Alternate name for the object


Question:
What is the difference between references and pointers?

1.References are an alias for a variable whereas pointer stores the address of a variable

2.References and pointers are similar

3.References stores address of variables whereas pointer points to variables

4.Pointers are an alias for a variable whereas references stores the address of a variable


Question:
What is the scope of the variable declared in the user defined function?

1.whole program

2.only inside the {} block

3.the main function

4.header section


Question:
What is the use of dynamic_cast operator?

1.it converts virtual base class to derived class

2.it converts the virtual base object to derived objects

3.it will convert the operator based on precedence

4.it converts the virtual base object to derived class


Question:
What is this operator called ?:?

1.conditional

2.relational

3.casting operator

4.unrelational


Question:
What will be used when terminating a structure?

1.:

2. }

3.;

4. ;;


Question:
What will happen when the structure is declared?

1.it will not allocate any memory

2. it will allocate the memory

3.it will be declared and initialized

4. it will be declared


Question:
When does the void pointer can be dereferenced?

1.when it doesn’t point to any value

2.when it cast to another type of object

3.using delete keyword

4.using shift keyword


Question:
Where does the execution of the program starts?

1. user-defined function

2.main function

3.void function

4.else function


Question:
Which function is used to check whether a character is a number?

1.isalpha()

2.isalnum()

3.isdigit()

4.isblank()


Question:
Which function is used to check whether a character is a tab or space?

1.isalpha()

2.isalnum()

3. isdigit()

4.isblank()


Question:
Which function is used to check whether a character is an alphabet?

1.isalpha()

2.isalnum()

3.isdigit()

4.isblank()


Question:
Which function is used to check whether a character is hexadecimal?

1.isxdigit()

2.isprint()

3.iscntrl()

4. ispunct()


Question:
Which function is used to check whether a character is printable on console?

1. isxdigit()

2.isprint()

3. iscntrl()

4. ispunct()


Question:
Which function is used to check whether a character is punctuation mark?

1.isxdigit()

2. isprint()

3.iscntrl()

4.ispunct()


Question:
Which function is used to check whether a character is tab or a control code?

1.isspace()

2. isalnum()

3.iscntrl()

4. isblank()


Question:
Which function is used to check whether a character is tab or space or whitespace control code(
,
,etc.)?

1. isspace()

2.isalnum()

3.iscntrl()

4.isblank()


Question:
Which looping process is best used when the number of iterations is known?

1. for

2.while

3.do-while

4.all looping processes require that the iterations be known


Question:
Which of the following accesses a variable in structure *b?

1.b->var;

2.b.var;

3.b-var;

4.b>var;


Question:
Which of the following function must use reference.

1.Assignment operator function

2.Copy Constructor

3.Destructor

4.Parameterized constructor


Question:
Which of the following is a properly defined structure?

1.struct {int a;}

2.struct a_struct {int a;}

3. struct a_struct int a;

4.struct a_struct {int a;};


Question:
Which of the following is incorrect?

1.References cannot be NULL

2.A reference must be initialized when declared

3.Once a reference is declared, it cannot be modified later to reference another object i.e. it cannot be reset

4.References cannot refer to a constant value


Question:
which of the following is used to terminate the function declaration?

1. :

2. )

3. ;

4. ]


Question:
Which of the following statement(s) is/are correct?

1.* operator is used to declare a reference

2.A reference variable defined to refer a particular variable can refer to any other variable also

3.References must always be initialized inside classes

4.A variable can have more than one references


Question:
Which operator is having the highest precedence?

1.postfix

2.unary

3.shift

4. equality


Question:
Which operator is having the right to left associativity in the following?

1.Array subscripting

2. Function call

3.Addition and subtraction

4. Type cast


Question:
Which reference modifier is used to define the reference variable?

1.&

2. $

3. #

4.@


Question:
Which value can we not assign to reference?

1.integer

2. floating

3.unsigned

4. null


More MCQS

  1. C++ Programming MCQS Set-1
  2. C++ Multiple Choice Questions Set-1
  3. C++ Multiple Choice Questions Set-2
  4. C++ Programming MCQS Set-2
  5. C++ Programming MCQS Set-3
  6. C++ Programming MCQS Set-4
  7. C++ (CPP) MCQ Question with Answer
  8. Advanced c++ multiple choice question(MCQS)
  9. OOPS Quiz Questions and Answers(MCQS)
  10. C Programming - MCQ Questions Set 1
  11. C Programming - MCQ Questions Set 2
  12. C Programming - MCQ Questions Set 3
  13. C Programming - MCQ Questions Set 4
  14. C Programming - MCQ Questions Set 5
  15. C++ programming language MCQ Questions Set 1
  16. C++ programming language MCQ Questions Set 2
  17. C++ programming language MCQ Questions Set 3
  18. C++ programming language MCQ Questions Set 4
  19. C++ programming language MCQ Questions Set 5
  20. C++ Programming -Constructors and Destructors
  21. C++ Programming -OOPS Concepts
  22. C++ Programming - References
  23. C++ Programming - Functions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!