कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is printed by the C code: int i = 0, j = 0; if (i++ || j++) ; printf("%d %d", i, j); ?
सही उत्तर: ग) 1 1
i++ yields 0 (false), so || must also evaluate j++; afterwards both i and j are 1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, given int f(int n) { if (n == 1) return 0; return 1 + f(n % 2 ? 3 * n + 1 : n / 2); } what is printed by printf("%d", f(6)); ?
सही उत्तर: ग) 8
The sequence is 6, 3, 10, 5, 16, 8, 4, 2, 1, which takes 8 steps to reach 1, and f counts the steps.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, given void f(void) { static int c = 0; c++; printf("%d", c); } what is printed by f(); f(); f(); ?
सही उत्तर: घ) 123
A static local variable is initialised only once and keeps its value between calls, so it prints 1, 2 and 3.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int c = 0, n = 29; while (n) { c += n & 1; n >>= 1; } printf("%d", c); ?
सही उत्तर: क) 4
29 is 11101 in binary; the loop adds each lowest bit before shifting, counting the four 1-bits.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int n = 12345, r = 0; while (n) { r = r * 10 + n % 10; n /= 10; } printf("%d", r); ?
सही उत्तर: ख) 54321
Each pass takes the last digit (n % 10), appends it to r and drops it from n, so the number is reversed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int a = 3, b = 4; printf("%d", a++ * --b); ?
सही उत्तर: ख) 9
a++ yields the old value 3 and --b yields the new value 3, so the product is 3 * 3 = 9.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: printf("%d", (int)strlen("Nep\0al")); ?
सही उत्तर: ग) 3
strlen() counts characters only up to the first null character, and "Nep\0al" has a \0 after three characters.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char s[] = "Pokhara"; printf("%c%c", s[0], s[strlen(s) - 1]); ?
सही उत्तर: घ) Pa
strlen(s) is 7, so s[6] is the last character a; s[0] is P, giving Pa.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: printf("%d", 'a' - 'A'); ?
सही उत्तर: क) 32
In ASCII 'a' is 97 and 'A' is 65, so the difference is 32; this is why adding 32 converts upper case to lower case.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which of the following is the strongest password?
सही उत्तर: ग) T7#qLm!2vR9z
A long password mixing upper- and lowercase letters, digits and symbols, and not based on dictionary words or dates, is hardest to guess.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।