Save as PDF

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

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

CB-103 (GS)

B.Tech., (Computer Science and Business System)

I Semester

Examination, December 2023

Grading System (GS)

Fundamentals of Computer Science

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
question should be treated as final.
किसी भी प्रकार के संदेह अथवा विवाद की स्थिति में अंग्रेजी भाषा
के प्रश्न को अंतिम माना जायेगा।

1. a)

Explain the function of flowcharts in solving problems. Generate a flowchart depicting the procedure for determining the factorial of a given number.

समस्याओं को हल करने में फ्लोचार्ट के कार्य की व्याख्या करें। दी गई संख्या के क्रमगुणन को निर्धारित करने की प्रक्रिया को दर्शाने वाला फ्लोचार्ट जनरेट करें।

b)

Explain the syntax and purpose of the ANSI C "while" loop. Give an example of how to use a "while" loop to perform repetitive tasks until a certain condition is met.

ANSI C "while" लूप के सिंटैक्स और उद्देश्य की व्याख्या करें। एक निदर्शित स्थिति पूरी होने तक दोहराए जाने वाले कार्यों को करने के लिए "while" लूप का उपयोग करने का उदाहरण दें।

2. a)

Define an algorithm and discuss its significance in solving problems. Illustrate an algorithm for sorting a list of numbers.

एल्गोरिथम को परिभाषित कीजिए तथा समस्याओं को हल करने में इसके महत्व की चर्चा कीजिए। संख्याओं की सूची की छंटनी के लिए एल्गोरिथम का उदाहरण दीजिए।

b)

Discuss the concept of decision-making using if-else statements in ANSI C. Provide an example that shows how if-else statements can be used to handle different scenarios in a program?

ANSI C में if-else स्टेटमेंट्स का उपयोग करके निर्णय लेने की अवधारणा पर चर्चा करें। एक उदाहरण प्���दान करें जो दिखाता है कि किसी प्रोग्राम में विभिन्न परिदृश्यों को संभालने के लिए if-else स्टेटमेंट्स का उपयोग कैसे किया जा सकता है?

3. a)

Discuss the programming concept of constants. Describe their function and benefits. Provide code examples demonstrating when and how constants can be used?

स्थिरांक की प्रोग्रामिंग अवधारणा पर चर्चा करें। इनके कार्य एवं लाभों का वर्णन कीजिए। स्थिरांकों का उपयोग कब और कैसे किया जा सकता है, इसका प्रदर्शन करने वाले कोड उदाहरण प्रदान करें।

b)

Explain the process of variable declaration in programming. Discuss the syntax and rules for declaring variables. Provide examples of variable declarations using different data types.

प्रोग्रामिंग में वेरिएबल डिक्लेरेशन की प्रक्रिया को समझाइए। चर घोषित करने के लिए सिंटैक्स और नियमों पर चर्चा करें। विभिन्न डाटा प्रकारों का उपयोग करते हुए परिवर्तनीय घोषणाओं के उदाहरण प्रदान करें।

4. a)

Implement a program that checks if a given string is a palindrome. Prompt the user to enter a string, perform the necessary operations, and display an appropriate message indicating whether the string is a palindrome or not. Use appropriate variable naming and logical operators.

एक प्रोग्राम लागू करें जो जांचता है कि क्या दी गई स्ट्रिंग पैलिंड्रोम है। उपयोगकर्ता को एक स्ट्रिंग दर्ज करने, आवश्यक संक्रियाएं करने के लिए प्रेरित करें, और एक उचित संदेश प्रदर्शित कर��ं जो दर्शाता है कि स्ट्रिंग एक पैलिंड्रोम है या नहीं। उचित चर नामकरण और तार्किक ऑपरेटरों का उपयोग करें।

b)

Consider both structured and unstructured programming. Describe the distinctions between the two approaches and how they affect code readability, maintainability, and debugging? Provide illustrations of each programming style.

संरचित और असंरचित प्रोग्रामिंग दोनों पर विचार करें। दो दृष्टिकोंणों के बीच अंतर का वर्णन करें और वे कोड पठनीयता, रखरखाव और डिबगिंग को कैसे प्रभावित करते हैं? प्रत्येक प्रोग्रामिंग शैली के चित्र प्रदान करें।

5. a)

In loops, discuss the use of break and continue statements. Explain how these statements affect control flow within loops. Give examples of situations where break and continue statements are commonly used.

लूप्स में ब्रेक और कंटिन्यू स्टेटमेंट्स के उपयोग पर चर्चा करें। व्याख्या करें कि ये कथन लूप के भीतर नियंत्रण प्रवाह को कैसे प्रभावित करते हैं। उन स्थितियों का उदाहरण दें जहाँ आमतौर पर ब्रेक और कंटिन्यू स्टेटमेंट का उपयोग किया जाता है।

b)

Describe the fundamentals of programming functions. Explain the function's purpose, the procedure for defining and calling functions, and the significance of function prototypes. Provide examples to illustrate the syntax and application of ANSI C functions.

प्रोग्रामिंग कार्यों के मूल सिद्धांतों का वर्णन करें। फंक्शन के उद्देश्य, फंक्शन को परिभाषित करने और कॉल करने की प्रक्रिया और फंक्शन प्रोटोटाइप के महत्व की व्याख्या करें। ANSI C कार्यों के सिंटैक्स और अनुप्रयोग को स्पष्ट करने के लिए उदाहर��� प्रदान करें।

6. a)

Describe pointers and their relationship with memory addresses. Discuss the advantages and disadvantages of programming with pointers. Provide examples of how to access and manipulate data using pointers.

पॉइंटर्स और मेमोरी के साथ उनके संबंध का वर्णन करें। पॉइंटर्स के साथ प्रोग्रामिंग के फायदे और नुकसान पर चर्चा करें। पॉइंटर्स का उपयोग करके डाटा तक पहुँचने और हेरफेर करने के तरीके के उदाहरण प्रदान करें।

b)

Explain the relationship between pointers and arrays. Discuss array representation as pointers and the effects of pointer arithmetic on array traversal. Give examples of how array pointers are used?

पॉइंटर्स और ऐरे के बीच संबंध को समझाएं। पॉइंटर्स के रूप में सरणी प्रतिनिधित्व और सरणी ट्रैवर्सल पर पॉइंटर अंकगणितीय के प्रभाव पर चर्चा करें। सरणी पॉइंटर्स का उपयोग कैसे किया जाता है इसका उदाहरण दें?

7. a)

Implement a program that searches for a specific element in a two-dimensional array using pointers.

एक प्रोग्राम को लागू करें जो पॉइंटर्स का उपयोग करके द्वि-आयामी सरणी में एक विशिष्ट तत्व की खोज करता है।

b)

Discuss the function of error handling functions in C programming, such as exit, perror, and the error.H header file.

C प्रोग्रामिंग में एरर हैंडलिंग फंक्शन्स के फंक्शन पर चर्चा करें, जैसे एग्जिट, पेरर और एरर.h हेडर फाइल।

8. a)

What does the term "variable-length argument lists" in C mean and how are they used in functions?

C अर्थ में "variable-length argument lists" शब्द क्या है और कार्यों में उनका उपयोग कैसे किया जाता है?

b)

Create a programme that uses fopen to read a text file and printf to display its contents on the console.

एक प्रोग्राम बनाएं जो पाठ फ़ाइल को पढ़ने के लिए fopen का उपयोग करता है और कंसोल पर इसकी सामग्री प्रदर्शित करने के लिए printf का उपयोग करता है।