कम्प्युटर ज्ञान – Computer Knowledge MCQ
कम्प्युटर ज्ञान – IT प्रवेश
Computer Knowledge · IT Entrance – B.Sc. CSIT, BIT & BCA · ३९१ प्रश्न
३९१ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर ज्ञान: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is the output of the following C code snippet? `int x = 10; float y = 2.5; int result = x * (int)y; printf("%d", result);` (a) 25 (b) 10 (c) 24 (d) Compilation error
सही उत्तर: घ) (d) Compilation error
The code performs integer multiplication with implicit type conversion. The float `y` (2.5) is cast to an integer during the calculation (`(int)y`). This truncation results in `y` becoming 2 before the multiplication takes place, so `x * 2 = 20`. Therefore, the output is 20.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Object-Oriented Programming (OOP), what is the primary purpose of 'inheritance'?
सही उत्तर: ख) To allow one class to inherit properties and methods from another class, promoting code reusability
Inheritance is a fundamental OOP concept where a derived (child) class inherits attributes and methods from its parent (base) class. This promotes code reuse, reduces redundancy, and establishes an 'is-a' relationship between classes. The other options describe different aspects of OOP like object instances, data types within a class, or memory management.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Consider a binary tree where each node has at most two children. How many nodes can be present in a full binary tree with a height of 3?
सही उत्तर: ग) 14
A full binary tree of height 3 means each level (from root to deepest leaf) has one more node than the previous. Level 0 (root): 1 node. Level 1: 2 nodes. Level 2: 4 nodes. Level 3: 8 nodes. Total = 1 + 2 + 4 + 8 = 15, but the question asks for nodes with a height of 3 so it's 1+2+4=7, however since the root is always counted as well we should add one to get 8. The most tempting incorrect option is 16 because this is the number of nodes in a complete binary tree.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which of the following best describes the purpose of hashing in computer science?
सही उत्तर: ग) To create a unique identifier (key) for each input and facilitate fast retrieval based on that key
Hashing is primarily used to create a unique 'hash' value from an input. This hash acts as a fingerprint, enabling quick lookup of data in a database or hash table without needing to compare the entire dataset. The other options are related to different concepts: sorting uses algorithms like merge sort, encryption protects data confidentiality, and compression reduces file size.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the following Python code? ```python def func(n): if n == 0: return 0 else: return n + func(n-1) print(func(3)) ```
सही उत्तर: क) 6
The function `func` is a recursive function that calculates the sum of numbers from 0 to n. When called with `func(3)`, it returns 3 + func(2), which returns 2 + func(1), which returns 1 + func(0). func(0) returns 0, so the final result is 3 + 2 + 1 + 0 = 6. The most tempting incorrect option is 7 because it represents a similar recursive calculation but with an incorrectly traced step.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the term ‘cache’ mean in the context of computer memory?
सही उत्तर: ख) B. A temporary storage area that speeds up access to frequently used data
A cache is a small, fast memory used to store copies of data from slower memory locations (like RAM) so future requests for that data can be served more quickly. Options A, C and D describe other storage or security components.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Consider the following C code: `int result = (5 % 3);`. What will be the value of 'result' after execution?
सही उत्तर: घ) D. 0
The modulo operator (%) returns the remainder of a division. 5 divided by 3 gives a quotient of 1 and a remainder of 2. Because we only store the remainder, result will equal 2. Option A is incorrect because it doesn't account for the mod operation; B and C are wrong answers.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which of the following statements about RAID (Redundant Array of Independent Disks) 5 is correct?
सही उत्तर: ग) It combines mirroring and striping to provide both redundancy and performance
RAID 5 utilizes a combination of mirroring and striping. Striping distributes data across multiple disks for performance, while mirroring provides redundancy by copying data to another disk in case of failure.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In object-oriented programming (OOP), what does ‘encapsulation’ refer to?
सही उत्तर: ख) Bundling data and methods that operate on that data within a single unit (class)
Encapsulation is a core OOP principle where data and the methods (functions) that operate on that data are bundled together into a single unit, protecting the data's integrity and simplifying code management.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which bitwise operator is used to find the difference between two numbers in terms of their set bits?
सही उत्तर: ग) XOR (^)
The XOR (^) operator returns 1 only when the corresponding bits are different. This effectively identifies the bits that are set in one number but not the other, representing the difference in their binary representation.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।