कम्प्युटर / सूचना प्रविधि कम्प्युटर अपरेटर (पाँचौँ तह) र सहायक – प्राविधिक पत्र
कम्प्युटर / सूचना प्रविधि – कम्प्युटर अपरेटर (पाँचौँ तह) र सहायक
Computer Operator & Assistant · Computer & IT Posts
१,५०२ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्राविधिक पत्र: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ५ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In C, two structure variables of the same type s1 and s2:
सही उत्तर: ख) can be assigned with s1 = s2 but cannot be compared with s1 == s2
Structure assignment copies all members, but C provides no == operator for structures; members must be compared individually.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
On a typical system where int is 4 bytes and must be aligned on a 4-byte boundary, sizeof(struct s { char c; int i; }) is usually:
सही उत्तर: ग) 8
The compiler inserts 3 padding bytes after c so that i is 4-byte aligned, giving 1 + 3 + 4 = 8 bytes.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Dereferencing a NULL pointer in a C program results in:
सही उत्तर: क) undefined behaviour, often a crash such as a segmentation fault
NULL does not point to any valid object, so accessing *p when p is NULL is undefined and usually crashes the program.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
On a typical 64-bit system, sizeof(char *) in C is:
सही उत्तर: ग) 8 bytes
A pointer holds an address; on 64-bit systems addresses are 64 bits (8 bytes) whatever type the pointer points to.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C function writes formatted output into a character array instead of to the screen?
सही उत्तर: ख) sprintf()
sprintf(buf, format, ...) works like printf but stores the result in the string buf.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The call fgets(buf, n, stdin) in C:
सही उत्तर: ख) reads at most n - 1 characters and keeps the newline in buf if one is read
fgets stops after n - 1 characters, at a newline (which it stores) or at end of file, and always adds the terminating '\0'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
How does puts(s) differ from printf("%s", s) in C?
सही उत्तर: क) puts() automatically adds a newline after the string
puts() writes the string followed by a newline character, whereas printf with %s does not add one.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C library function searches a string for the first occurrence of another string (substring)?
सही उत्तर: ख) strstr()
strstr(haystack, needle) returns a pointer to the first occurrence of needle, or NULL.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C library function returns a pointer to the first occurrence of a given character in a string?
सही उत्तर: घ) strchr()
strchr(s, c) searches s for the character c and returns a pointer to it, or NULL if it is not found.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, accessing a[10] for an array declared as int a[10]; results in:
सही उत्तर: ख) undefined behaviour, because C does not check array bounds
Valid indices are 0 to 9; C performs no bounds checking, so reading or writing a[10] is undefined behaviour.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।