TRE4 C and C++ Quiz practice set 2

Que: (1). Which of the following approaches is used by C++?

B.
A.
C.
D.
E.
Open question page

Que: (2). Which programming paradigm is primarily supported by C++?

A.
C.
B.
D.
E.
Open question page

Que: (3). Which feature of C++ allows a program to create objects from a user-defined data type?

A.
B.
C.
D.
E.
Open question page

Que: (4). Which OOP concept in C++ combines data and the functions that operate on that data into a single unit?

A.
C.
B.
D.
E.
Open question page

Que: (5). Which OOP feature allows a new C++ class to acquire properties and behaviour of an existing class?

B.
A.
C.
D.
E.
Open question page

Que: (6). Which OOP concept allows the same function name to perform different operations in different situations?

B.
A.
C.
D.
E.
Open question page

Que: (7). Which of the following is NOT a fundamental principle of object-oriented programming in C++?

A.
B.
C.
D.
E.
Open question page

Que: (8). Which approach generally starts by designing smaller components and then combines them to form a complete system?

B.
A.
C.
D.
E.
Open question page

Que: (9). Which of the following is used to hide the internal implementation details of an object in C++?

A.
C.
B.
D.
E.
Open question page

Que: (10). Which of the following allows the same function name to be used with different parameter lists in C++?

B.
A.
C.
D.
E.
Open question page

Que: (11). What is virtual inheritance in C++?

B.
C.
A.
D.
E.
Open question page

Que: (12). Which problem is commonly solved by virtual inheritance in C++?

C.
A.
B.
D.
E.
Open question page

Que: (13). Which keyword is used with a base class in C++ to implement virtual inheritance?

A.
C.
B.
D.
E.
Open question page

Que: (14). In C++, which type of function is mainly used to achieve run-time polymorphism?

A.
B.
C.
D.
E.
Open question page

Que: (15). What is the main purpose of a virtual destructor in C++?

A.
B.
C.
D.
E.
Open question page

Que: (16). Which of the following can be overridden in a derived C++ class?

B.
C.
A.
D.
E.
Open question page

Que: (17). What happens when a pure virtual function is declared in a C++ class?

C.
A.
B.
D.
E.
Open question page

Que: (18). Which statement about multiple inheritance in C++ is correct?

A.
B.
C.
D.
E.
Open question page

Que: (19). In C++, what is the effect of declaring a member function as final?

A.
B.
C.
D.
E.
Open question page

Que: (20). Which inheritance access mode makes public and protected members of the base class remain public and protected in the derived class?

C.
A.
B.
D.
E.
Open question page

Que: (21). What happens if the following C++ statement is compiled and executed? int *ptr = NULL; delete ptr;

B.
A.
C.
D.
E.
Open question page

Que: (22). Which operator is used in C++ to dynamically allocate memory for a single object?

C.
A.
B.
D.
E.
Open question page

Que: (23). Which operator should normally be used to release memory allocated using new in C++?

C.
B.
A.
D.
E.
Open question page

Que: (24). Which operator should be used to release an array allocated using new[] in C++?

A.
C.
B.
D.
E.
Open question page

Que: (25). What is a memory leak in a C++ program?

C.
A.
B.
D.
E.
Open question page

Que: (26). What is a dangling pointer in C++?

C.
B.
A.
D.
E.
Open question page

Que: (27). What is the purpose of setting a pointer to nullptr after deleting its dynamically allocated object?

C.
A.
B.
D.
E.
Open question page

Que: (28). What happens when new cannot allocate the requested memory in its normal form?

C.
B.
A.
D.
E.
Open question page

Que: (29). Which C++ smart pointer provides exclusive ownership of a dynamically allocated object?

A.
B.
C.
D.
E.
Open question page

Que: (30). Which C++ smart pointer allows multiple smart pointers to share ownership of the same object?

B.
C.
A.
D.
E.
Open question page

Que: (31). What is the difference between delete and delete[] in C++?

B.
C.
A.
D.
E.
Open question page

Que: (32). Which C++ operator is used to allocate memory for an array dynamically?

B.
C.
A.
D.
E.
Open question page

Que: (33). What is the main purpose of RAII in modern C++?

B.
C.
A.
D.
E.
Open question page

Que: (34). Which special member function is automatically called when a C++ object goes out of scope?

A.
C.
B.
D.
E.
Open question page

Que: (35). What is the result of allocating memory using new without storing the returned address anywhere?

B.
C.
A.
D.
E.
Open question page

Que: (36). Which smart pointer is designed for non-owning observation of an object managed by shared_ptr?

A.
B.
C.
D.
E.
Open question page

Que: (37). What can happen if a program accesses memory through a pointer after the pointed object has been destroyed?

B.
A.
C.
D.
E.
Open question page

Que: (38). Which C++ feature automatically manages dynamically allocated objects and reduces the need for explicit delete statements?

C.
A.
B.
D.
E.
Open question page

Que: (39). What is the main purpose of a copy constructor in C++?

B.
A.
C.
D.
E.
Open question page

Que: (40). Which situation can lead to a double-delete error in C++?

B.
C.
A.
D.
E.
Open question page

Que: (41). What happens if the following program is executed in C and C++? int new=5; printf("%d", new);

B.
C.
A.
D.
E.
Open question page

Que: (42). Which of the following can be used as an identifier in both C and C++?

C.
A.
B.
D.
E.
Open question page

Que: (43). Which of the following is a valid identifier in C?

B.
A.
C.
D.
E.
Open question page

Que: (44). Which statement about keywords in C and C++ is correct?

C.
B.
A.
D.
E.
Open question page

Que: (45). Which of the following is a keyword in C++ but not a keyword in C?

C.
A.
B.
D.
E.
Open question page

Que: (46). What is the output of the following C program? int main() { int x = 10; printf("%d", x); }

A.
C.
B.
D.
E.
Open question page

Que: (47). Which format specifier is normally used with printf() to display an integer value of type int?

C.
A.
B.
D.
E.
Open question page

Que: (48). Which of the following statements about identifiers in C and C++ is correct?

C.
A.
B.
D.
E.
Open question page

Que: (49). Which statement is correct about the case sensitivity of C and C++?

B.
A.
C.
D.
E.
Open question page

Que: (50). Which of the following statements about the main() function in a standard C/C++ program is correct?

A.
B.
C.
D.
E.
Open question page

Que: (51). What is the value of p in the following C++ code snippet?

                            int p;
bool a=true;
bool b=false;
int x=10;
int y=5;
p=((x|y)+(a+b));
cout<<p;
                        
C.
A.
B.
D.
E.
Open question page

Que: (52). What will be the output of the following C++ code?

                            int x=12;
int y=10;
cout << (x & y);
                        
C.
B.
A.
D.
E.
Open question page

Que: (53). What is the output of the following C++ code?

                            int x=7;
int y=5;
cout << (x ^ y);
                        
B.
A.
C.
D.
E.
Open question page

Que: (54). What will be the output of the following C++ code?

                            int x=3;
cout << (x << 2);
                        
B.
A.
C.
D.
E.
Open question page

Que: (55). What will be the output of the following C++ code?

                            int x=16;
cout << (x >> 2);
                        
A.
B.
C.
D.
E.
Open question page

Que: (56). Which operator is used to perform bitwise NOT in C++?

                            int x=5;
cout << (~x);
                        
C.
A.
B.
D.
E.
Open question page

Que: (57). What will be the output of the following C++ code?

                            bool a=true;
bool b=true;
int result=a+b;
cout << result;
                        
A.
C.
B.
D.
E.
Open question page

Que: (58). What is the output of the following C++ expression?

                            int x=6;
int y=3;
cout << x & y + 1;
                        
A.
C.
B.
D.
E.
Open question page

Que: (59). What will be the value of x after executing the following C++ code?

                            int x=4;
x |= 3;
cout << x;
                        
A.
C.
B.
D.
E.
Open question page

Que: (60). What will be the output of the following C++ code?

                            int x=8;
if(x & 8)
    cout << "Yes";
else
    cout << "No";
                        
C.
A.
B.
D.
E.
Open question page

Que: (61). The C++ code which causes abnormal termination or behaviour of a program should be written under _____ block.

C.
B.
A.
D.
E.
Open question page

Que: (62). Which statement is used to explicitly generate an exception in C++?

A.
C.
B.
D.
E.
Open question page

Que: (63). Which block is used to handle an exception in C++?

C.
B.
A.
D.
E.
Open question page

Que: (64). What happens when an exception is thrown in C++ and a matching catch block is found?

B.
C.
A.
D.
E.
Open question page

Que: (65). Which of the following can be thrown as an exception in C++?

C.
B.
A.
D.
E.
Open question page

Que: (66). Which catch block can be used to catch an exception of any type in C++?

A.
C.
B.
D.
E.
Open question page

Que: (67). What is the purpose of a nested try block in C++?

B.
C.
A.
D.
E.
Open question page

Que: (68). Which statement about the finally block in standard C++ exception handling is correct?

A.
B.
C.
D.
E.
Open question page

Que: (69). What happens if no matching catch handler is found for a thrown exception?

A.
C.
B.
D.
E.
Open question page

Que: (70). Which order is generally used in C++ exception handling?

A.
C.
B.
D.
E.
Open question page

Que: (71). What will be the output of the following C++ code?

                            #include <iostream.h>
using namespace std;

void square(int *x, int *y)
{
    *x = (*x) * --(*y);
}

int main()
{
    int number = 30;
    square(&number, &number);
    cout << number;
    return 0;
}
                        
A.
C.
B.
D.
E.
Open question page

Que: (72). What will be the output of the following C++ code?

                            int x = 25;
int *p = &x;
cout << *p;
                        
A.
B.
C.
D.
E.
Open question page

Que: (73). What will be the output of the following C++ code?

                            int x = 10;
int *p = &x;
*p = 20;
cout << x;
                        
A.
B.
C.
D.
E.
Open question page

Que: (74). What will be the output of the following C++ code?

                            void change(int &x)
{
    x = 50;
}

int main()
{
    int a = 10;
    change(a);
    cout << a;
}
                        
A.
C.
B.
D.
E.
Open question page

Que: (75). Which statement is correct about a const reference in C++?

                            int x = 10;
const int &ref = x;
                        
C.
B.
A.
D.
E.
Open question page

Que: (76). What happens when a null pointer is dereferenced in C++?

                            int *p = nullptr;
cout << *p;
                        
A.
C.
B.
D.
E.
Open question page

Que: (77). What will be the output of the following C++ code?

                            int x = 10;
int *p = &x;
int **q = &p;
cout << **q;
                        
B.
A.
C.
D.
E.
Open question page

Que: (78). What will be the output of the following C++ code?

                            int arr[] = {10, 20, 30};
int *p = arr;
cout << *(p + 1);
                        
A.
B.
C.
D.
E.
Open question page

Que: (79). What will be the output of the following C++ code?

                            int x = 5;
int a = x++;
int b = ++x;
cout << a << " " << b << " " << x;
                        
A.
B.
C.
D.
E.
Open question page

Que: (80). What will be printed by the following C++ code?

                            int x = 10;
int *p = &x;
int *q = &x;

if(p == q)
    cout << "Same";
else
    cout << "Different";
                        
B.
A.
C.
D.
E.
Open question page

Que: (81). Pick the incorrect statement about inline functions in C++.

C.
B.
A.
D.
E.
Open question page

Que: (82). Which feature of C++ allows multiple functions to have the same name but different parameter lists?

                            int add(int a, int b);
double add(double a, double b);
                        
A.
B.
C.
D.
E.
Open question page

Que: (83). What will be the output of the following C++ code?

                            int sum(int a, int b = 10)
{
    return a + b;
}

int main()
{
    cout << sum(5);
}
                        
A.
B.
C.
D.
E.
Open question page

Que: (84). Which C++ feature allows a function to work with different data types without writing separate functions for each type?

                            template <typename T>
T maximum(T a, T b)
{
    return (a > b) ? a : b;
}
                        
C.
B.
A.
D.
E.
Open question page

Que: (85). What is a function called when it calls itself directly or indirectly?

                            int factorial(int n)
{
    if(n <= 1)
        return 1;
    return n * factorial(n - 1);
}
                        
C.
B.
A.
D.
E.
Open question page

Que: (86). Which C++ feature provides a concise way to define an unnamed function object?

                            auto square = [](int x)
{
    return x * x;
};

cout << square(5);
                        
C.
A.
B.
D.
E.
Open question page

Que: (87). Which of the following can store the address of a function in C++?

                            int add(int a, int b)
{
    return a + b;
}

int (*ptr)(int, int) = add;
                        
B.
A.
C.
D.
E.
Open question page

Que: (88). What will be the output of the following C++ code?

                            void change(int x)
{
    x = 100;
}

int main()
{
    int a = 20;
    change(a);
    cout << a;
}
                        
A.
B.
C.
D.
E.
Open question page

Que: (89). What will be the output of the following C++ code?

                            int calculate()
{
    return 25;
}

int main()
{
    int x = calculate();
    cout << x;
}
                        
A.
C.
B.
D.
E.
Open question page

Que: (90). Which return type should normally be used for a C++ function that does not return a value?

                            void display()
{
    cout << "Hello";
}
                        
A.
B.
C.
D.
E.
Open question page

Que: (91). What is abstract class in C++?

A.
B.
C.
D.
E.
Open question page

Que: (92). Which of the following is the correct syntax for declaring a pure virtual function in C++?

                            class Base
{
public:
    virtual void display() = 0;
};
                        
A.
C.
B.
D.
E.
Open question page

Que: (93). What happens if an attempt is made to create an object of an abstract class in C++?

                            class Shape
{
public:
    virtual void draw() = 0;
};

Shape s;
                        
B.
A.
C.
D.
E.
Open question page

Que: (94). What must a derived class generally do to become a concrete class when inheriting from an abstract class?

                            class Base
{
public:
    virtual void show() = 0;
};

class Derived : public Base
{
public:
    void show() override
    {
        cout << "Derived";
    }
};
                        
A.
B.
C.
D.
E.
Open question page

Que: (95). What will be the output of the following C++ code?

                            class Base
{
public:
    virtual void show()
    {
        cout << "Base";
    }
};

class Derived : public Base
{
public:
    void show() override
    {
        cout << "Derived";
    }
};

int main()
{
    Base *p = new Derived();
    p->show();
}
                        
B.
C.
A.
D.
E.
Open question page

Que: (96). Which statement about a pure virtual function in C++ is correct?

                            class Base
{
public:
    virtual void show() = 0;
};
                        
B.
A.
C.
D.
E.
Open question page

Que: (97). Can a pointer or reference to an abstract class be declared in C++?

                            class Shape
{
public:
    virtual void draw() = 0;
};

Shape *ptr;
                        
B.
A.
C.
D.
E.
Open question page

Que: (98). In C++, a class containing only pure virtual functions is commonly used to represent which concept?

                            class Printable
{
public:
    virtual void print() = 0;
    virtual void save() = 0;
};
                        
B.
C.
A.
D.
E.
Open question page

Que: (99). What is the purpose of the override specifier in C++?

                            class Derived : public Base
{
public:
    void show() override;
};
                        
A.
B.
C.
D.
E.
Open question page

Que: (100). Which statement about constructors of abstract classes in C++ is correct?

                            class Base
{
public:
    Base()
    {
        cout << "Base";
    }

    virtual void show() = 0;
};
                        
B.
C.
A.
D.
E.
Open question page

Que: (101). Which of the following constructors is provided by the C++ compiler if not defined in a class?

A.
B.
C.
D.
E.
Open question page

Que: (102). What is constructor overloading in C++?

A.
B.
C.
D.
E.
Open question page

Que: (103). Which feature of a C++ constructor is used to initialize data members before the constructor body executes?

C.
B.
A.
D.
E.
Open question page

Que: (104). Why must a const data member generally be initialized using a constructor initializer list in C++?

B.
A.
C.
D.
E.
Open question page

Que: (105). What is the main purpose of the explicit keyword with a C++ constructor?

C.
A.
B.
D.
E.
Open question page

Que: (106). Which of the following statements about a C++ constructor is correct?

A.
B.
C.
D.
E.
Open question page

Que: (107). What is the purpose of a delegating constructor introduced in modern C++?

B.
C.
A.
D.
E.
Open question page

Que: (108). Which type of constructor is primarily associated with transferring resources from a temporary or expiring object in modern C++?

A.
C.
B.
D.
E.
Open question page

Que: (109). What is the effect of declaring a C++ class constructor as private?

C.
B.
A.
D.
E.
Open question page

Que: (110). Which statement about the return type of a C++ constructor is correct?

A.
C.
B.
D.
E.
Open question page

Que: (111). How do structures and classes in C++ differ?

B.
A.
C.
D.
E.
Open question page

Que: (112). Which access specifier can be used to make a member of a C++ structure private?

A.
C.
B.
D.
E.
Open question page

Que: (113). Which of the following can be declared inside a C++ structure?

A.
C.
B.
D.
E.
Open question page

Que: (114). What is the default inheritance access specifier when a C++ class is derived from a struct?

B.
A.
C.
D.
E.
Open question page

Que: (115). What is the default inheritance mode when a C++ struct derives from another type?

C.
A.
B.
D.
E.
Open question page

Que: (116). Which statement about using a struct name in C++ is correct?

A.
B.
C.
D.
E.
Open question page

Que: (117). Which operator is normally used to access a public data member of a structure object in C++?

C.
B.
A.
D.
E.
Open question page

Que: (118). Which operator is used to access a member through a pointer to a C++ structure object?

C.
A.
B.
D.
E.
Open question page

Que: (119). Which statement is correct regarding the following C++ declarations?

B.
A.
C.
D.
E.
Open question page

Que: (120). Which feature is supported by a structure in C++ but is not supported by a traditional structure in C?

A.
B.
C.
D.
E.
Open question page

Que: (121). Which of the following is the original creator of the C++ language?

A.
B.
C.
D.
E.
Open question page

Que: (122). What was the original name of the C++ language during its early development?

C.
A.
B.
D.
E.
Open question page

Que: (123). At which organization was C++ originally developed by Bjarne Stroustrup?

C.
B.
A.
D.
E.
Open question page

Que: (124). Which programming language was the main base for the early development of C++?

A.
B.
C.
D.
E.
Open question page

Que: (125). Which organization is primarily responsible for international standardization of the C++ programming language?

B.
C.
A.
D.
E.
Open question page

Que: (126). Which of the following was the first ISO standardized version of C++?

A.
B.
C.
D.
E.
Open question page

Que: (127). Which C++ standard introduced major modern language features such as lambda expressions and auto type deduction?

C.
B.
A.
D.
E.
Open question page

Que: (128). Which C++ standard introduced the if constexpr feature?

C.
B.
A.
D.
E.
Open question page

Que: (129). Which C++ standard introduced concepts and the ranges library as major modern C++ features?

C.
B.
A.
D.
E.
Open question page

Que: (130). Which sequence correctly represents the development order of these C++ standards?

A.
B.
C.
D.
E.
Open question page

Que: (131). Which of the following is the correct syntax to read the single character to console in the C++ language?

A.
C.
B.
D.
E.
Open question page

Que: (132). Which operator is used with cin to extract input from the standard input stream in C++?

B.
C.
A.
D.
E.
Open question page

Que: (133). Which operator is commonly used with cout to display output in C++?

B.
A.
C.
D.
E.
Open question page

Que: (134). Which C++ stream function can be used to extract and discard characters from the input stream?

C.
B.
A.
D.
E.
Open question page

Que: (135). Which C++ function is commonly used to read an entire line of text, including spaces?

A.
B.
C.
D.
E.
Open question page

Que: (136). Which C++ input stream function examines the next character without extracting it from the stream?

B.
C.
A.
D.
E.
Open question page

Que: (137). Which C++ output stream function is used to write a single character to the output stream?

A.
C.
B.
D.
E.
Open question page

Que: (138). Which function can be used to check whether the end-of-file condition has been reached on a C++ stream?

B.
C.
A.
D.
E.
Open question page

Que: (139). Which C++ stream manipulator forces the output buffer to be flushed?

C.
B.
A.
D.
E.
Open question page

Que: (140). What happens when the extraction operator cin >> is used to read a string containing spaces?

A.
C.
B.
D.
E.
Open question page

Que: (141). Which of the following gives the nth element of the Array?

B.
C.
A.
D.
E.
Open question page

Que: (142). At which index does the first element of a C++ array normally begin?

B.
A.
C.
D.
E.
Open question page

Que: (143). What is the last valid index of an array declared as int a[10] in C++?

A.
B.
C.
D.
E.
Open question page

Que: (144). How many elements can be stored in an array declared as int marks[25]?

A.
B.
C.
D.
E.
Open question page

Que: (145). What is the value of the remaining elements when a partially initialized integer array is declared as int a[5] = {10, 20};?

B.
C.
A.
D.
E.
Open question page

Que: (146). Which loop is most commonly used to traverse every element of a fixed-size C++ array using its index?

A.
B.
C.
D.
E.
Open question page

Que: (147). Which declaration correctly creates a two-dimensional integer array with 3 rows and 4 columns in C++?

C.
B.
A.
D.
E.
Open question page

Que: (148). Which declaration creates a character array capable of storing the string "CAT" including its null character?

B.
A.
C.
D.
E.
Open question page

Que: (149). What can happen when a C++ program accesses an array element outside its valid bounds?

C.
A.
B.
D.
E.
Open question page

Que: (150). Which C++ feature can be used to conveniently iterate over all elements of an array without explicitly using an array index?

C.
A.
B.
D.
E.
Open question page

Que: (151). How many types of the array are there in the C++ programming language?

A.
B.
C.
D.
E.
Open question page

Que: (152). Which of the following is a valid declaration of an integer array in C++?

A.
C.
B.
D.
E.
Open question page

Que: (153). Which of the following can be declared in C++?

A.
B.
C.
D.
E.
Open question page

Que: (154). Which statement correctly describes int *p[5] in C++?

B.
A.
C.
D.
E.
Open question page

Que: (155). If int a[10] is declared and an int occupies 4 bytes, what is the total size of array a?

B.
A.
C.
D.
E.
Open question page

Que: (156). When a built-in array is passed to a function in the usual way, what is generally passed to the function?

C.
B.
A.
D.
E.
Open question page

Que: (157). In most expressions, what does the name of a built-in C++ array represent or convert to?

C.
B.
A.
D.
E.
Open question page

Que: (158). Which expression dynamically allocates an array of 10 integers in C++?

A.
B.
C.
D.
E.
Open question page

Que: (159). Which operator should be used to release memory allocated using new[] for a C++ array?

A.
B.
C.
D.
E.
Open question page

Que: (160). Which C++ Standard Library container provides a fixed-size array with useful member functions such as size()?

C.
B.
A.
D.
E.
Open question page

Que: (161). In C++, for what purpose is the rank() used?

B.
C.
A.
D.
E.
Open question page

Que: (162). Which C++ type trait is used to determine the size of a particular array dimension?

C.
A.
B.
D.
E.
Open question page

Que: (163). Which C++ type trait checks whether a given type is an array type?

A.
C.
B.
D.
E.
Open question page

Que: (164). What is the value of std::rank<int[2][3][4]>::value in C++?

B.
C.
A.
D.
E.
Open question page

Que: (165). Which header file provides std::rank and std::extent in C++?

A.
C.
B.
D.
E.
Open question page

Que: (166). What does std::extent<int[5]>::value return in C++?

B.
C.
A.
D.
E.
Open question page

Que: (167). Which C++ type trait can be used to remove the outermost array dimension from an array type?

B.
A.
C.
D.
E.
Open question page

Que: (168). Which C++ type trait removes all array dimensions from an array type?

B.
C.
A.
D.
E.
Open question page

Que: (169). What does std::rank<int>::value return in C++?

B.
A.
C.
D.
E.
Open question page

Que: (170). Which statement correctly describes C++ type traits such as std::rank?

C.
B.
A.
D.
E.
Open question page

Que: (171). What is the scope of the variable declared in a user-defined function?

A.
B.
C.
D.
E.
Open question page

Que: (172). A variable declared inside a function is generally known as what?

B.
A.
C.
D.
E.
Open question page

Que: (173). What happens if a local variable and a global variable have the same name in C++?

C.
A.
B.
D.
E.
Open question page

Que: (174). Where is a global variable normally declared in a C++ program?

B.
A.
C.
D.
E.
Open question page

Que: (175). What is the scope of a variable declared inside an if block in C++?

B.
C.
A.
D.
E.
Open question page

Que: (176). Which operator can be used to access a global variable when it is hidden by a local variable with the same name?

A.
C.
B.
D.
E.
Open question page

Que: (177). What is special about the lifetime of a static local variable in C++?

A.
C.
B.
D.
E.
Open question page

Que: (178). Which statement about a function parameter in C++ is correct?

B.
A.
C.
D.
E.
Open question page

Que: (179). What is the scope of a variable declared in a nested block inside a function?

A.
C.
B.
D.
E.
Open question page

Que: (180). Which statement correctly distinguishes scope and lifetime of a variable in C++?

A.
C.
B.
D.
E.
Open question page

Que: (181). Which one of the following is the correct definition of the is_array() function in C++?

A.
B.
C.
D.
E.
Open question page

Que: (182). Which C++ type trait is used to check whether a type is an integral type?

A.
C.
B.
D.
E.
Open question page

Que: (183). Which type trait can be used to determine whether a C++ type is a floating-point type?

B.
A.
C.
D.
E.
Open question page

Que: (184). Which C++ type trait checks whether a specified type is a pointer type?

C.
A.
B.
D.
E.
Open question page

Que: (185). What does std::is_const<const int>::value return?

B.
A.
C.
D.
E.
Open question page

Que: (186). Which C++ type trait is used to determine whether a type is a reference type?

C.
B.
A.
D.
E.
Open question page

Que: (187). Which type trait checks whether a given type is a class type in C++?

A.
C.
B.
D.
E.
Open question page

Que: (188). What is the purpose of std::is_same in C++?

C.
B.
A.
D.
E.
Open question page

Que: (189). Which C++ type trait checks whether a specified type is void?

A.
C.
B.
D.
E.
Open question page

Que: (190). What does std::is_pointer<int>::value return in C++?

B.
C.
A.
D.
E.
Open question page

Que: (191). Which of the following statements is true about new and malloc? I. The new is a type of operator while malloc is a kind of function. II. The new invokes a constructor, whereas malloc does not invoke the constructor. III. The malloc returns void pointer and also needed to typecast whereas new returns required pointer.

C.
A.
B.
D.
E.
Open question page

Que: (192). Which C library function is used to allocate memory for a specified number of elements and initialize the allocated memory to zero?

B.
A.
C.
D.
E.
Open question page

Que: (193). Which function is used to change the size of a previously allocated memory block in C?

A.
C.
B.
D.
E.
Open question page

Que: (194). Which function is used to release dynamically allocated memory obtained using malloc(), calloc() or realloc()?

C.
A.
B.
D.
E.
Open question page

Que: (195). Which statement correctly describes calloc() and malloc()?

A.
B.
C.
D.
E.
Open question page

Que: (196). What does malloc() return when the requested memory allocation cannot be satisfied?

C.
B.
A.
D.
E.
Open question page

Que: (197). Which function is commonly used to fill a block of memory with a specified byte value?

A.
B.
C.
D.
E.
Open question page

Que: (198). Which function is generally used to copy a specified number of bytes from one memory area to another?

B.
A.
C.
D.
E.
Open question page

Que: (199). Which header is traditionally associated with malloc(), calloc(), realloc() and free() in C++?

B.
A.
C.
D.
E.
Open question page

Que: (200). Which statement about realloc() is correct?

C.
B.
A.
D.
E.
Open question page

Que: (201). What will happen if in a C++ program, a class has no name?

A.
C.
B.
D.
E.
Open question page

Que: (202). Which statement correctly describes an unnamed class in C++?

C.
B.
A.
D.
E.
Open question page

Que: (203). What is the main limitation of an unnamed class regarding constructors?

A.
C.
B.
D.
E.
Open question page

Que: (204). Which of the following can be declared inside an unnamed class in C++?

C.
A.
B.
D.
E.
Open question page

Que: (205). What is a local class in C++?

C.
B.
A.
D.
E.
Open question page

Que: (206). Which statement about a nested class in C++ is correct?

C.
B.
A.
D.
E.
Open question page

Que: (207). What is the purpose of a class declaration in C++?

B.
C.
A.
D.
E.
Open question page

Que: (208). Which keyword is used to define a class in C++?

B.
A.
C.
D.
E.
Open question page

Que: (209). What does the name of a class primarily represent in C++?

C.
A.
B.
D.
E.
Open question page

Que: (210). Which statement about a class object in C++ is correct?

B.
A.
C.
D.
E.
Open question page