What is correct about the static data member of a class?
A static member function can access only static data members of a class.
A static data member is shared among all the objects of the class.
A static data member can be accessed directly from main().
Both A and B.
The question asks about the properties of a static data member in a class. We need to evaluate each option based on the rules and characteristics of static members in object-oriented programming, particularly in C++.
static keyword. Unlike regular data members, a static data member is not associated with any specific object of the class. Instead, it belongs to the class itself.this pointer), they cannot access non-static (instance-specific) data members. They can only operate on static data members or other static member functions.main(). While static data members can be accessed without an object, they are still members of a class and typically require the class name and the scope resolution operator (::) for access (e.g., ClassName::staticMember). Direct access like a global variable is not usually allowed unless it's a public member and accessed with the scope resolution operator. So, "directly" without any qualification is generally incorrect.D) Both A and B. Both statements accurately describe the behavior of static data members and static member functions. A static data member is indeed shared among all objects, and a static member function can only access static data members.
this pointer and thus cannot access non-static (instance-specific) data members. However, since option D includes this correct statement along with another correct one, D is the better answer.ClassName::staticMember), not "directly" like a global variable without any qualification.The question asks to identify which of the given options is NOT a type of constructor in object-oriented programming (specifically C++ context, which is common in competitive exams). We need to recall the different types of constructors and their definitions.
B) Friend constructor is not a type of constructor. The concept of a "friend constructor" does not exist in object-oriented programming languages like C++.
\(\sqrt{5.4756}\) = ?
To find the square root of a decimal number, we can use the long division method or estimation. For competitive exams, estimation combined with checking the last digit and the magnitude of the number is often the quickest way to arrive at the correct answer.
We need to find \(\sqrt{5.4756}\).
We know that \(2^2 = 4\) and \(3^2 = 9\). Since \(5.4756\) is between \(4\) and \(9\), its square root must be between \(2\) and \(3\). This eliminates options B and C immediately.
The given number is \(5.4756\). The last digit is \(6\). When a number is squared, its last digit is determined by the last digit of the original number.
Since the given number \(5.4756\) ends in \(6\), its square root must end in either \(4\) or \(6\). Among the remaining options (A) \(2.24\) and (D) \(2.34\), both end in \(4\). This step helps narrow down, but doesn't fully distinguish between A and D.
Let's check the squares of the remaining plausible options.
Let's calculate \((2.34)^2\):
\[ 2.34 \times 2.34 \]\[ \quad 2.34 \]\[ \underline{\times 2.34} \]\[ \quad 936 \quad (234 \times 4) \]\[ \quad 7020 \quad (234 \times 30) \]\[ \underline{46800 \quad (234 \times 200)} \]\[ 5.4756 \]Since \((2.34)^2 = 5.4756\), the square root of \(5.4756\) is \(2.34\).
D) 2.34 is the correct answer because \((2.34)^2 = 5.4756\).
The question asks about the primary function of the ozone layer in the Earth's atmosphere. The ozone layer is crucial for protecting life on Earth by absorbing harmful radiation from the sun. We need to identify which type of radiation it primarily restricts.
D) Ultraviolet radiation — The ozone layer is primarily known for its role in absorbing and restricting harmful ultraviolet (UV) radiation from the sun. This protection is essential for life on Earth, as excessive UV exposure can cause severe health problems and environmental damage.
Which one of the following statements is true?
Auto indentation is not possible in vi editor
Auto indentation can be set using the command ':set ai'
Auto indentation can be set using the command ':set noai'
Auto indentation is set by default in vi editor
The question asks about the functionality of auto indentation in the vi editor and how to enable or disable it. We need to identify the correct command for setting auto indentation.
:) followed by set and the option name.ai. To enable an option, the command is :set option_name. Therefore, to enable auto indentation, the command would be :set ai.B) Auto indentation can be set using the command ':set ai'
This statement is correct. In the vi editor, the command :set ai is used to turn on auto indentation. This feature helps in maintaining consistent code formatting by automatically indenting new lines.
A) Auto indentation is not possible in vi editor — This statement is incorrect. Auto indentation is a standard feature available in the vi editor and its derivatives like Vim, which significantly aids in code formatting.
C) Auto indentation can be set using the command ':set noai' — This statement is incorrect. The command :set noai is used to disable auto indentation, not enable it. To enable it, one uses :set ai.
D) Auto indentation is set by default in vi editor — This statement is generally incorrect. While some modern Vim configurations might have auto indentation enabled by default, the classic vi editor typically does not have auto indentation enabled by default. Users usually need to explicitly set it using :set ai or configure it in their .vimrc file.
The question asks to identify which of the given options represents a logical topology. We need to understand the difference between physical and logical topologies in computer networks.
Correct Option: D) Both (A) and (B)
Token Ring is a classic example of a logical topology because it defines how data is accessed and transmitted using a token-passing mechanism, independent of the physical wiring. While Mesh is often described as a physical topology due to its wiring scheme, the concept of data flowing directly between any two nodes via dedicated links also describes a logical aspect of how data can be routed and transmitted within such a network. Therefore, both can be considered logical topologies in different contexts.
The question asks to identify the Indian personality who received the Knight Grand Cross, the UK's highest civilian award, in 2014. This is a factual question related to awards and honors, requiring knowledge of prominent Indian figures and their international accolades.
Correct Option: D) Ratan Tata was awarded the honorary Knight Grand Cross of the Most Excellent Order of the British Empire (GBE) in 2014. This is the highest civilian honor that can be bestowed by the UK on a foreign national.
The question asks to identify the company that changed its name to Mondelez India Foods Ltd. This requires knowledge of corporate rebranding and the history of major food companies operating in India.
C) Cadburys India — Cadbury India Ltd. officially changed its name to Mondelez India Foods Ltd. in April 2014, following its acquisition by Kraft Foods (which later spun off its global snacks business as Mondelez International).
We are given the area of a rectangular plot and a relationship between its length and breadth. We need to find the breadth. We will use the formula for the area of a rectangle and set up an equation based on the given information to solve for the breadth.
Let the breadth of the rectangular plot be \(b\) metres.
The problem states that the length is 15% more than the breadth. So, the length \(l\) can be expressed as:
\[ l = b + 0.15b = 1.15b \]The area of a rectangle is given by the formula: Area = Length × Breadth.
We are given that the area is 460 square metres. So,
\[ l \times b = 460 \]Substitute the expression for \(l\) from step 2 into the area formula:
\[ (1.15b) \times b = 460 \]\[ 1.15b^2 = 460 \]Now, solve for \(b^2\):
\[ b^2 = \frac{460}{1.15} \]\[ b^2 = \frac{460}{\frac{115}{100}} \]\[ b^2 = \frac{460 \times 100}{115} \]\[ b^2 = \frac{46000}{115} \]Perform the division:
\[ b^2 = 400 \]Take the square root of both sides to find \(b\):
\[ b = \sqrt{400} \]\[ b = 20 \]Since breadth must be a positive value, the breadth of the plot is 20 metres.
Correct Option: B) 20 metres
Which of the following statements is true in C++?
A struct cannot have member functions
A struct cannot have private members
The default access modifier of struct is public
None of these
The question asks to identify the true statement regarding C++ structs. We need to evaluate each option based on the rules and characteristics of structs in C++.
struct and a class in C++. For a struct, if no access specifier is explicitly mentioned, members (both data and functions) are by default public. For a class, the default is private.C) The default access modifier of struct is public. This is a key distinction between struct and class in C++. While both can have member functions, constructors, destructors, and private/protected/public members, the default access for struct members is public, whereas for class members it is private.