Save as PDF

Opens your browser print dialog — select "Save as PDF" to download.

Total No. of Questions: 8 [Total No. of Printed Pages : 4]
Roll No.

CB-303 (GS)

B.Tech., III Semester

Examination, December 2023

Grading System (GS)

Object Oriented Programming

Time : Three Hours Maximum Marks : 70

Note: i) Attempt any five questions.

किन्हीं पाँच प्रश्नों को हल कीजिए।

ii) All questions carry equal marks.

सभी प्रश्नों के समान अंक हैं।

iii) In case of any doubt or dispute the English version should be treated as final.

किसी भी प्रकार के संदेह अथवा विवाद की स्थिति में अंग्रेजी भाषा के प्रश्न को अंतिम माना जायेगा।

1. a)

List iterative statements in C++. Explain each with suitable example.

C++ में पुनरावृत्ति कथनों की सूची बनाइये। उपयुक्त उदाहरण के साथ प्रत्येक की व्याख्या करें।

(7)

b)

Define pointer? Write a C++ program to read the array of integers and print the biggest and smallest element among given array elements using pointers.

सूचक परिभाषित करें। पूर्णांकों की सरणी को पढ़ने के लिए एक C++ प्रोग्राम लिखें और पॉइंटर्स का उपयोग करके दिए गए सरणी तत्वों में से सबसे ब��़ा और सबसे छोटा तत्व प्रिंट करें।

(7)

2. a)

List the various preprocessor directives in C++. Explain with suitable example.

C++ में विभिन्न प्रीप्रोसेसर निर्देशों की सूची बनाइये। उपयुक्त उदाहरण देकर समझाइए।

(7)

b)

Explain the concept of default arguments using C++ program.

C++ प्रोग्राम का उपयोग करते हुए डिफॉल्ट तर्कों की अवधारणा को समझाइए।

(7)

3. a)

What is function overloading? What are the principles of function overloading?

फंक्शन ओवरलोडिंग क्या है? फंक्शन ओवरलोडिंग के सिद्धांत क्या हैं?

(7)

b)

What are the different types of variables scopes? Explain with an example.

वेरिएबल्स स्कोप के विभिन्न प्रकार क्या हैं? उदाहरण सहित स्पष्ट कीजिए।

(7)

4. a)

Explain the difference between private, protected and public access specifiers in C++ programming. How do they affect the accessibility of class members? Explain with examples.

C++ प्रोग्रामिंग में प्राइवेट, प्रोटेक्टेड और पब्लिक एक्सेस स्पेसिफायर के बीच अंतर स्पष्ट करें। वे कक्षा के सदस्यों की पहुँच को कैसे प्रभावित करते हैं? उदाहरण सहित समझाइए।

(7)

b)

What is the "this" keyword in C++ programming? How is it used to refer to the current object? Explain with examples.

C++ प्रोग्रामिंग में “this” कीवर्ड क्या है? वर्तमान वस्तु को संदर्भित करने के लिए इसका उपयोग कैसे किया जाता है? उदाहरण सहित समझाइए।

(7)

5. a)

How does scope resolution operator (::) work in C++ programming? Explain with examples.

C++ प्रोग्रामिंग में स्कोप रेजोल्यूशन ऑपरेटर (::) कैसे काम करता है? उदाहरण सहित समझाइए।

(7)

b)

Discuss the concept of virtual functions in inheritance in C++. How can we use virtual functions to achieve dynamic binding and polymorphism in derived classes? Explain with examples.

C++ में वंशानुक्रम में आभासी कार्यों की अवध���रणा पर चर्चा करें। व्युत्पन्न कक्षाओं में गतिशील बंधन और बहुरूपता प्राप्त करने के लिए हम आभासी कार्यों का उपयोग कैसे कर सकते हैं? उदाहरण सहित समझाइए।

(7)

6. a)

Explain how we can use constructors and destructors in inherited classes in C++. How do they work in the inheritance hierarchy?

बताएँ कि हम C++ में इनहेरिटेड क्लासेस में कंस्ट्रक्टर्स और डिस्ट्रक्टर्स का उपयोग कैसे कर सकते ह��ं। वे वंशानुक्रम पदानुक्रम में कैसे काम करते हैं?

(7)

b)

Define template. What is the need for templates in programming? Write C++ code to declare a Template class.

टेम्पलेट को परिभाषित करें। प्रोग्रामिंग में टेम्पलेट्स की क्या आवश्यकता है? Template क्लास घोषित करने के लिए C++ कोड लिखें।

(7)

7. a)

What are input and output streams in C++? How are they useful in handling data?

C++ में इनपुट और आउटपुट स्ट्रीम क्या हैं? वे डाटा को संभालने में कैसे उपयोगी हैं?

(7)

b)

Write a C++ program to read the content of one file and copy to another file.

एक फाइल की सामग्री को पढ़ने और दूसरी फाइल में कॉपी करने के लिए एक C++ प्रोग्राम लिखें।

(7)

8.

Write short note on following:

निम्नलिखित पर संक्षिप्त टिप्पणियाँ लिखिए:

a)

Friend keyword

(5)

b)

New and delete operators

(5)

c)

Call by value and call by reference

(4)