13 questions · about 15 minutes. Press End Mock any time to see your score and the correct answers.
In context of C++, which of the following is a valid statement ?
C++ के संदर्भ में, निम्न में से कौन-सा एक उचित कथन है ?
Correct answer: C. Keywords private, protected and public may appear in any order and any number of times in a class.एक क्लास में Private, Protected तथा public की - वड्र्स किसी भी क्रम में तथा कितनी भी बार आ सकते हैं।
Access specifiers may appear any number of times in any order inside a class. A friend is not a member, static data can be changed, and non-static member functions can also use static data.
क्लास में private, protected, public कितनी भी बार किसी भी क्रम में आ सकते हैं। फ्रेंड फलन सदस्य नहीं होता, स्टेटिक डेटा बदला जा सकता है और नॉन-स्टेटिक फलन भी उसे एक्सेस कर सकते हैं।
In C file handling equivalent to scanf("%d",&val); is :
C फाइल हैंडलिंग में scanf("%d",&val); के तुल्य है :
Correct answer: A. fscanf(stdin, "%d",&val);
scanf reads from standard input, so it equals fscanf(stdin, "%d", &val).
scanf मानक इनपुट से पढ़ता है, अतः यह fscanf(stdin, "%d", &val) के बराबर है।
A variable declared within the block {} has the following scope :
ब्लॉक {} के भीतर घोषित एक चर का निम्नलिखित स्कोप होता है :
Correct answer: B. Local Scopeलोकल स्कोप
A variable declared inside a block { } has local (block) scope.
ब्लॉक { } के भीतर घोषित चर का स्कोप लोकल होता है।
What is a copy constructor ?
कॉपी कंस्ट्रक्टर क्या है ?
Correct answer: B. A constructor to initialize an object with the values of another object.एक कंस्ट्रक्टर जो किसी ऑब्जेक्ट को किसी अन्य ऑब्जेक्ट के मानों या वैल्यू के साथ प्रारंभ करता है।
A copy constructor initialises a new object with the values of an existing object of the same class.
कॉपी कंस्ट्रक्टर नए ऑब्जेक्ट को उसी क्लास के किसी मौजूदा ऑब्जेक्ट के मानों से प्रारंभ करता है।
In the given declaration of an array : float height[50];
एक ऐरे के निम्न डिक्लेरेशन में : float height[50];
Correct answer: A. height[0] refers to first element of array.height[0] ऐरे के पहले तत्त्व को संदर्भित करता है।
Array indexing starts at 0, so height[0] is the first element.
ऐरे का इंडेक्स 0 से शुरू होता है, अतः height[0] पहला तत्व है।
The functions 'cin' and 'cout' resolve the necessary conversions at :
फंक्शन 'cin' और 'cout' आवश्यक रूपांतरणों को हल करते हैं :
Correct answer: A. Compile timeसंकलन के समय
The right overloaded >> or << operator for each data type is chosen by the compiler, i.e. at compile time.
हर डेटा टाइप के लिए सही >>/<< ऑपरेटर कंपाइलर चुनता है, यानी कंपाइल समय पर।
In C++, << operator used for shifting bits can also be used for :
C++ में बिट खिसकाने वाले ऑपरेटर << को और किस कार्य में प्रयोग किया जा सकता है ?
Correct answer: A. Displaying valuesमान दर्शाने में
<< is overloaded as the insertion operator for output: cout << x displays values.
<< को आउटपुट के लिए ओवरलोड किया गया है: cout << x मान दिखाता है।
Which of the following is the scope resolution operator in C++ language ?
C++ लैंग्वेज में निम्नलिखित में से कौन - सा स्कोप रिजॉल्यूशन ऑपरेटर है ?
Correct answer: C. : :
:: is the scope resolution operator (e.g. ClassName::member).
:: स्कोप रिज़ॉल्यूशन ऑपरेटर है (जैसे ClassName::member)।
Inheritance allows the following in C++ program :
इनहेरिटेंस C++ प्रोग्राम में निम्नलिखित की अनुमति देता है :
Correct answer: D. All options are correctसभी विकल्प सही हैं
Inheritance gives reusability, class hierarchies and extensibility — all options.
इनहेरिटेंस से पुनःप्रयोज्यता, क्लास पदानुक्रम और विस्तारशीलता — सब मिलते हैं।
A generic function can be created using the following :
निम्नलिखित का उपयोग करके एक जेनेरिक फंक्शन बनाया जा सकता है :
Correct answer: D. Templateटेम्प्लेट
Templates (template <class T>) create generic functions and classes.
टेम्प्लेट (template <class T>) से जेनेरिक फंक्शन/क्लास बनते हैं।
Consider the following C++ statements :
int x; int& y = x;
The statements
y = 25; x = 2*x + 30;
update the value of x and y as :
निम्नलिखित C++ कथनों पर विचार करें :
कथन
x और y के मान को अपडेट करता है :
Correct answer: D. y = 80, x = 80
y is a reference (alias) of x. y = 25 makes x = 25; then x = 2 × 25 + 30 = 80, and y shows the same 80.
y, x का रेफरेंस (उपनाम) है। y = 25 से x = 25; फिर x = 2 × 25 + 30 = 80, और y भी 80।
Which symbol should be used to pass the object by reference in C++ ?
C++ में रेफरेंस द्वारा ऑब्जेक्ट को पास करने के लिए किस चिन्ह का उपयोग किया जाना चाहिए ?
Correct answer: A. &
& declares a reference parameter: void f(Box &b).
& से रेफरेंस पैरामीटर बनता है: void f(Box &b)।
What is meant by multiple inheritance ?
मल्टिपल इनहेरिटेंस से क्या तात्पर्य है ?
Correct answer: C. Deriving a derived class from more than one base classएक से अधिक बेस क्लास से व्युत्पन्न क्लास प्राप्त करना
Multiple inheritance: one derived class inherits from more than one base class.
मल्टिपल इनहेरिटेंस: एक व्युत्पन्न क्लास एक से अधिक बेस क्लास से बनती है।