Connection restored!
Notification Center
Loading notifications...
Loading announcements...
INCOMING 1v1 DUEL! 10:00
@friend challenged you!
Topic · Room #HQ-0000
Accept & Join
Mention Scholar ↑↓ Enter / Click
Last time you were studying on Page 2.
STUDY & LEARNING DECK Filtered: 📜 PYQs

Govt Exam PYQs

Showing 25 of 2870 total questions (Latest Added First).

Timed Quiz
Newest Classic 25 Qs
No Questions Match Your Filter

Try clearing filters or unchecking "Saved" / "Hide".

Question 1376 NEW
📜 PYQs EASY
Which function in C is used to release dynamically allocated heap memory to prevent memory leaks?
मेमोरी लीक से बचने के लिए डायनामिक रूप से आवंटित हीप मेमोरी को मुक्त करने हेतु C में किस फंक्शन का उपयोग किया जाता है?
A
`delete()`
`delete()`
B
`remove()`
`remove()`
C
`clear()`
`clear()`
D
`free()`
`free()`
Correct
Solution Breakdown:
-> Every `malloc()` or `calloc()` call in C should be paired with `free(ptr)` once the memory is no longer needed. -> Hence, Option (D) is the correct answer.
-> डायनामिक मेमोरी को खाली करने के लिए `free()` फंक्शन का उपयोग किया जाता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1377 NEW
📜 PYQs MEDIUM
What is the difference between `malloc()` and `calloc()` in C?
C भाषा में `malloc()` और `calloc()` के बीच क्या मुख्य अंतर है?
A
`malloc()` is only for strings
`malloc()` केवल स्ट्रिंग्स के लिए है
B
Both initialize memory to zero
दोनों मेमोरी को शून्य से इनिशियलाइज़ करते हैं
C
`malloc()` leaves allocated memory uninitialized (garbage values), whereas `calloc()` initializes all allocated bytes to ZERO
`malloc()` आवंटित मेमोरी को अन-इनिशियलाइज़्ड (गार्बेज वैल्यू) छोड़ता है, जबकि `calloc()` सभी बाइट्स को शून्य (`0`) से भर देता है
Correct
D
`calloc()` cannot allocate arrays
`calloc()` एरे आवंटित नहीं कर सकता
Solution Breakdown:
-> `malloc(n * sizeof(int))` takes 1 argument and is slightly faster; `calloc(n, sizeof(int))` takes 2 arguments and zeroes out the memory safely. -> Hence, Option (C) is the correct answer.
-> `malloc()` में गार्बेज वैल्यू रहती है, जबकि `calloc()` मेमोरी को `0` से साफ कर देता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1378 NEW
📜 PYQs MEDIUM
Which standard library function in C dynamically allocates a block of uninitialized memory on the Heap and returns a `void*` pointer?
C भाषा में कौन सा मानक लाइब्रेरी फंक्शन हीप पर डायनामिक मेमोरी आवंटित करता है और `void*` पॉइंटर लौटाता है?
A
`new`
`new`
B
`malloc()`
`malloc()`
Correct
C
`free()`
`free()`
D
`alloc_mem()`
`alloc_mem()`
Solution Breakdown:
-> `malloc(size)` (Memory Allocation, in `stdlib.h`) allocates raw heap memory at runtime; `calloc()` allocates zero-initialized memory, and `free()` releases it. -> Hence, Option (B) is the correct answer.
-> `malloc()` रन-टाइम पर हीप मेमोरी आवंटित करता है और `free()` उसे मुक्त करता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1379 NEW
📜 PYQs EASY
Which shortcut key is used in classic Turbo C/C++ IDE to compile a C program?
क्लासिक टर्बो C/C++ IDE में किसी C प्रोग्राम को कंपाइल करने के लिए किस शॉर्टकट कुंजी का उपयोग किया जाता है?
A
`Alt + F9`
`Alt + F9`
Correct
B
`Ctrl + F9`
`Ctrl + F9`
C
`Alt + F5`
`Alt + F5`
D
`Alt + C`
`Alt + C`
Solution Breakdown:
-> In Turbo C/C++, `Alt + F9` compiles the program, whereas `Ctrl + F9` compiles and runs it. -> Hence, Option (A) is the correct answer.
-> टर्बो C में `Alt + F9` से प्रोग्राम कंपाइल होता है और `Ctrl + F9` से रन होता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1380 NEW
📜 PYQs MEDIUM
What will be the output of the following C code? int x = 3, y = 9; x = x + y; y = x - y; x = x - y; printf("%d, %d", x, y);
उपरोक्त C कोड का आउटपुट क्या होगा?
A
`3, 9`
`3, 9`
B
`12, 9`
`12, 9`
C
`3, 12`
`3, 12`
D
`9, 3`
`9, 3`
Correct
Solution Breakdown:
-> This is the classic swap-without-temp-variable logic: `x = 12`, then `y = 12 - 9 = 3`, then `x = 12 - 3 = 9`. Output: `9, 3`. -> Hence, Option (D) is the correct answer.
-> यह बिना तीसरे वेरिएबल के मान बदलने (Swapping) का प्रसिद्ध कोड है, जिससे `x=9` और `y=3` प्रिंट होगा। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1381 NEW
📜 PYQs MEDIUM
What is the value of the C ternary expression `(x - 5) ? 15 : 25` when `int x = 4;`?
यदि `int x = 4;` है, तो C टर्नरी व्यंजक `(x - 5) ? 15 : 25` का मान क्या होगा?
A
0
0
B
25
25
C
15
15
Correct
D
-1
-1
Solution Breakdown:
-> In C, ANY non-zero value is treated as `True` and `0` is `False`. Here `x - 5 = 4 - 5 = -1` (non-zero = True), so the ternary operator selects the first branch: `15`. -> Hence, Option (C) is the correct answer.
-> C में शून्य को छोड़कर हर संख्या `True` मानी जाती है। यहाँ `4 - 5 = -1` (`True`) है, इसलिए उत्तर `15` होगा। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1382 NEW
📜 PYQs MEDIUM
What will be the output of the following C code snippet? int i = 0; for (; i <= 5; i++) ; printf("%d", i);
उपरोक्त C कोड का आउटपुट क्या होगा?
A
5
5
B
6
6
Correct
C
0
0
D
12345
12345
Solution Breakdown:
-> The `for` loop has an empty body (`;`) and keeps incrementing `i` until `i <= 5` becomes false, which happens when `i` becomes `6`. Then `printf()` runs once and prints `6`. -> Hence, Option (B) is the correct answer.
-> `for` लूप `i = 6` होने पर रुकता है और उसके बाहर लिखा `printf` एक बार चलकर `6` प्रिंट करता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1383 NEW
📜 PYQs MEDIUM
What will be the output of the following C code snippet? int array[] = {2, 3, 4, 5}; printf("%d", 2[array]);
उपरोक्त C कोड का आउटपुट क्या होगा?
A
4
4
Correct
B
3
3
C
2
2
D
5
5
Solution Breakdown:
-> In C, array indexing `array[2]` is internally translated by the compiler to `*(array + 2)`, which is mathematically identical to `*(2 + array)` or `2[array]`. Index 2 holds `4`. -> Hence, Option (A) is the correct answer.
-> C कंपाइलर `2[array]` को `array[2]` के समान मानता है, और इंडेक्स 2 पर `4` स्टोर है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1384 NEW
📜 PYQs EASY
Which format specifier is used inside `printf()` in C to print a single character?
C भाषा में `printf()` के अंदर एक सिंगल कैरेक्टर प्रिंट करने के लिए किस फॉर्मेट स्पेसिफायर का उपयोग किया जाता है?
A
`%d`
`%d`
B
`%f`
`%f`
C
`%s`
`%s`
D
`%c`
`%c`
Correct
Solution Breakdown:
-> Common C format specifiers: `%c` = single character, `%d` = integer, `%f` = float, `%s` = string. -> Hence, Option (D) is the correct answer.
-> `%c` कैरेक्टर के लिए, `%d` पूर्णांक के लिए, `%f` फ्लोट के लिए और `%s` स्ट्रिंग के लिए उपयोग होता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1385 NEW
📜 PYQs MEDIUM
Consider the C union `union data { int a; float b; char str[20]; };`. If `char = 1`, `int = 2`, and `float = 4` bytes, what is the total memory size of a variable of this union?
C यूनियन `union data { int a; float b; char str[20]; };` में यदि `char=1`, `int=2`, `float=4` बाइट्स हैं, तो इस यूनियन वेरिएबल का कुल आकार क्या होगा?
A
26 bytes
26 बाइट्स
B
4 bytes
4 बाइट्स
C
20 bytes
20 बाइट्स
Correct
D
2 bytes
2 बाइट्स
Solution Breakdown:
-> A union allocates memory equal to the size of its LARGEST member. Here, `char str[20]` takes $20 \times 1 = 20$ bytes (larger than 2 and 4), so the union size is 20 bytes. -> Hence, Option (C) is the correct answer.
-> यूनियन का आकार उसके सबसे बड़े सदस्य के बराबर होता है, जो यहाँ `char str[20]` (20 बाइट्स) है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1386 NEW
📜 PYQs MEDIUM
In C, what is the main difference between a `struct` (Structure) and a `union`?
C भाषा में `struct` (स्ट्रक्चर) और `union` (यूनियन) के बीच मुख्य अंतर क्या है?
A
Structures can only store integers
स्ट्रक्चर केवल पूर्णांक स्टोर कर सकते हैं
B
In a `struct`, every member gets its own separate memory space; in a `union`, all members SHARE the exact same memory location (size equals the largest member)
`struct` में हर सदस्य को अलग मेमोरी मिलती है, जबकि `union` में सभी सदस्य एक ही मेमोरी स्थान साझा करते हैं (आकार सबसे बड़े सदस्य के बराबर होता है)
Correct
C
Unions are not supported in C
C में यूनियन सपोर्ट नहीं होता
D
Both allocate the exact same amount of memory
दोनों बिल्कुल समान मेमोरी लेते हैं
Solution Breakdown:
-> Because union members share memory, only ONE member of a union can hold a valid value at a given time, saving RAM in memory-constrained systems. -> Hence, Option (B) is the correct answer.
-> यूनियन में सभी सदस्य एक ही मेमोरी साझा करते हैं, इसलिए एक समय में केवल एक ही सदस्य का मान सक्रिय रहता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1387 NEW
📜 PYQs MEDIUM
If an `int` takes 2 bytes in memory, what is the total size of the 2D C array `int arr[3][4];`?
यदि एक `int` मेमोरी में 2 बाइट्स लेता है, तो 2D C एरे `int arr[3][4];` का कुल आकार क्या होगा?
A
24 bytes
24 बाइट्स
Correct
B
12 bytes
12 बाइट्स
C
14 bytes
14 बाइट्स
D
7 bytes
7 बाइट्स
Solution Breakdown:
-> Total elements in `arr[3][4]` = $3 \times 4 = 12$ integers. Total size = $12 \times 2\text{ bytes} = 24\text{ bytes}$. -> Hence, Option (A) is the correct answer.
-> कुल तत्व $= 3 \times 4 = 12$ और कुल मेमोरी $= 12 \times 2 = 24\text{ बाइट्स}$। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1388 NEW
📜 PYQs MEDIUM
What is the total memory size (in bytes) of the following C string array declaration: `char name[] = "abcde";` (assuming 1 char = 1 byte)?
C में `char name[] = "abcde";` की कुल मेमोरी साइज़ (बाइट्स में) क्या होगी (यदि 1 अक्षर = 1 बाइट)?
A
4 bytes
4 बाइट्स
B
5 bytes
5 बाइट्स
C
7 bytes
7 बाइट्स
D
6 bytes
6 बाइट्स
Correct
Solution Breakdown:
-> In C, every string literal automatically ends with a hidden Null Terminator character (`\0`) taking 1 extra byte. Thus, 5 letters (`a,b,c,d,e`) + 1 null character (`\0`) = 6 bytes. -> Hence, Option (D) is the correct answer.
-> C में हर स्ट्रिंग के अंत में एक नल कैरेक्टर (`\0`) अपने आप जुड़ता है, इसलिए 5 अक्षर + 1 नल कैरेक्टर = 6 बाइट्स। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1389 NEW
📜 PYQs EASY
What is the correct way to declare an integer constant `size` with value `10` in C?
C भाषा में `10` मान वाले पूर्णांक कॉन्स्टेंट `size` को घोषित करने का सही तरीका क्या है?
A
`const size = 10;`
`const size = 10;`
B
`constant int size = 10;`
`constant int size = 10;`
C
`const int size = 10;`
`const int size = 10;`
Correct
D
`int const = 10;`
`int const = 10;`
Solution Breakdown:
-> Placing the `const` keyword before the data type (`const int size = 10;`) makes the variable read-only so its value cannot be altered later. -> Hence, Option (C) is the correct answer.
-> `const` कीवर्ड के साथ डेटा टाइप और शुरुआती मान देकर कॉन्स्टेंट बनाया जाता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1390 NEW
📜 PYQs EASY
Which of the following is the correct declaration of a 2-Dimensional (double-dimensioned) integer array in C?
C भाषा में 2-डायमेंशनल पूर्णांक एरे की सही घोषणा कौन सी है?
A
`int arr[2, 2];`
`int arr[2, 2];`
B
`int arr[2][2];`
`int arr[2][2];`
Correct
C
`int arr(2)(2);`
`int arr(2)(2);`
D
`int *arr[10];`
`int *arr[10];`
Solution Breakdown:
-> A 2D array in C uses two separate pairs of square brackets for rows and columns: `int arr[rows][cols];`. -> Hence, Option (B) is the correct answer.
-> 2D एरे में रो और कॉलम के लिए दो अलग-अलग स्क्वायर ब्रैकेट `[2][2]` लगाए जाते हैं। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1391 NEW
📜 PYQs EASY
Which of the following is the correct way to declare a 10-element integer array named `marks` in C?
C भाषा में `marks` नामक 10-तत्वों वाले पूर्णांक एरे की सही घोषणा कौन सी है?
A
`int marks[10];`
`int marks[10];`
Correct
B
`int marks(10);`
`int marks(10);`
C
`int marks{10};`
`int marks{10};`
D
`array int marks[10];`
`array int marks[10];`
Solution Breakdown:
-> In C, arrays are declared using square brackets `[ ]` specifying the size: `data_type array_name[size];`. -> Hence, Option (A) is the correct answer.
-> C में एरे घोषित करने के लिए स्क्वायर ब्रैकेट `[ ]` का उपयोग किया जाता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1392 NEW
📜 PYQs EASY
Which keyword is used in C to define a function that returns NO value?
C भाषा में ऐसा फंक्शन परिभाषित करने के लिए जो कोई मान रिटर्न नहीं करता, किस कीवर्ड का उपयोग किया जाता है?
A
`null`
`null`
B
`empty`
`empty`
C
`none`
`none`
D
`void`
`void`
Correct
Solution Breakdown:
-> `void` is an empty data type keyword used as a function return type (e.g., `void display()`) when no value needs to be returned to the caller. -> Hence, Option (D) is the correct answer.
-> जब किसी फंक्शन को कोई मान वापस नहीं लौटाना होता, तो उसका रिटर्न टाइप `void` रखा जाता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1393 NEW
📜 PYQs EASY
By default, how are arguments passed to functions in the C programming language?
C प्रोग्रामिंग भाषा में डिफ़ॉल्ट रूप से फंक्शंस में आर्ग्युमेंट्स कैसे पास किए जाते हैं?
A
Call by Reference
कॉल बाय रेफरेंस
B
Call by Address
कॉल बाय एड्रेस
C
Call by Value
कॉल बाय वैल्यू
Correct
D
Call by Name
कॉल बाय नेम
Solution Breakdown:
-> C always passes arguments by Value by default (sending a copy). Call by Reference is simulated in C by explicitly passing memory addresses using pointers. -> Hence, Option (C) is the correct answer.
-> C में डिफ़ॉल्ट रूप से कॉल बाय वैल्यू का उपयोग होता है; कॉल बाय रेफरेंस के लिए पॉइंटर्स (`&` और `*`) का उपयोग करना पड़ता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1394 NEW
📜 PYQs EASY
Which standard library function in C is used to close an opened file?
C भाषा में किसी खुली हुई फाइल को बंद करने के लिए किस मानक लाइब्रेरी फंक्शन का उपयोग किया जाता है?
A
`closefile()`
`closefile()`
B
`fclose()`
`fclose()`
Correct
C
`fileclose()`
`fileclose()`
D
`closef()`
`closef()`
Solution Breakdown:
-> In C file handling (`stdio.h`), `fopen()` opens a file and `fclose(fp)` flushes buffers and safely closes the file pointer `fp`. -> Hence, Option (B) is the correct answer.
-> C में फाइल खोलने के लिए `fopen()` और बंद करने के लिए `fclose()` फंक्शन का उपयोग किया जाता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1395 NEW
📜 PYQs MEDIUM
In C, if a variable is declared with the `register` storage class, which operator CANNOT be applied to it?
C भाषा में, यदि किसी वेरिएबल को `register` स्टोरेज क्लास के साथ घोषित किया गया है, तो उस पर कौन सा ऑपरेटर लागू नहीं किया जा सकता?
A
Address-of operator (`&`)
एड्रेस-ऑफ ऑपरेटर (`&`)
Correct
B
Increment operator (`++`)
इंक्रीमेंट ऑपरेटर (`++`)
C
Addition operator (`+`)
जोड़ ऑपरेटर (`+`)
D
Logical NOT (`!`)
लॉजिकल NOT (`!`)
Solution Breakdown:
-> A `register` variable is requested to be stored directly inside a CPU register instead of RAM, and CPU registers do not have RAM memory addresses, so `&` is invalid. -> Hence, Option (A) is the correct answer.
-> `register` वेरिएबल RAM के बजाय CPU रजिस्टर में स्टोर होता है जिसका कोई RAM एड्रेस नहीं होता, इसलिए इस पर `&` ऑपरेटर नहीं लगाया जा सकता। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1396 NEW
📜 PYQs MEDIUM
What is the default storage class for all local variables declared inside a function in C?
C भाषा में किसी फंक्शन के अंदर घोषित सभी लोकल वेरिएबल्स की डिफ़ॉल्ट स्टोरेज क्लास क्या होती है?
A
`static`
`static`
B
`extern`
`extern`
C
`register`
`register`
D
`auto`
`auto`
Correct
Solution Breakdown:
-> `auto` (automatic) is the default storage class for local variables; they are created automatically when the function begins and destroyed when it exits. -> Hence, Option (D) is the correct answer.
-> लोकल वेरिएबल्स की डिफ़ॉल्ट स्टोरेज क्लास `auto` होती है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1397 NEW
📜 PYQs MEDIUM
Which storage class in C allows a local variable to RETAIN its value between multiple calls to the same function?
C भाषा में कौन सी स्टोरेज क्लास किसी लोकल वेरिएबल को एक ही फंक्शन के कई कॉल्स के बीच अपना मान सुरक्षित रखने की अनुमति देती है?
A
`auto`
`auto`
B
`register`
`register`
C
`static`
`static`
Correct
D
`extern`
`extern`
Solution Breakdown:
-> A `static` local variable is initialized only once and stays alive in memory until the end of the entire program, retaining its updated value across function calls. -> Hence, Option (C) is the correct answer.
-> `static` लोकल वेरिएबल केवल एक बार इनिशियलाइज़ होता है और पूरे प्रोग्राम के अंत तक मेमोरी में अपना मान बनाए रखता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1398 NEW
📜 PYQs MEDIUM
If `X`, `Y`, and `Z` are pointer variables of type `char*`, `int*`, and `float*` respectively on the same C system, what is true about their memory sizes?
यदि एक ही C सिस्टम पर `X`, `Y` और `Z` क्रमशः `char*`, `int*` और `float*` प्रकार के पॉइंटर वेरिएबल हैं, तो उनके मेमोरी आकार के बारे में क्या सत्य है?
A
`Z` is larger than `X`
`Z` का आकार `X` से बड़ा है
B
All three pointers (`X`, `Y`, and `Z`) have the exact SAME memory size
तीनों पॉइंटर्स (`X`, `Y` और `Z`) का मेमोरी आकार बिल्कुल समान होता है
Correct
C
`Y` is larger than `X`
`Y` का आकार `X` से बड़ा है
D
`X` takes only 1 byte
`X` केवल 1 बाइट लेता है
Solution Breakdown:
-> Every pointer stores a memory address (not the actual data), so on a 32-bit system all pointers take 4 bytes and on a 64-bit system all pointers take 8 bytes regardless of data type. -> Hence, Option (B) is the correct answer.
-> हर पॉइंटर केवल मेमोरी एड्रेस स्टोर करता है, इसलिए डेटा टाइप कुछ भी हो, सभी पॉइंटर्स का आकार समान होता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1399 NEW
📜 PYQs EASY
Which of the following is the correct declaration of an integer pointer variable `p` in C?
C भाषा में पूर्णांक पॉइंटर वेरिएबल `p` की सही घोषणा निम्नलिखित में से कौन सी है?
A
`int *p;`
`int *p;`
Correct
B
`int &p;`
`int &p;`
C
`int p;`
`int p;`
D
`pointer int p;`
`pointer int p;`
Solution Breakdown:
-> Placing an asterisk (`*`) between the data type and variable name declares a pointer (`int *p;` means `p` is a pointer to an `int`). -> Hence, Option (A) is the correct answer.
-> डेटा टाइप के बाद `*` लगाकर पॉइंटर घोषित किया जाता है, जैसे `int *p;`। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1400 NEW
📜 PYQs EASY
What is a "Pointer" variable in C programming used to store?
C प्रोग्रामिंग में "पॉइंटर" वेरिएबल का उपयोग क्या स्टोर करने के लिए किया जाता है?
A
Only decimal values
केवल दशमलव मान
B
Only string text
केवल स्ट्रिंग टेक्स्ट
C
The name of a function
किसी फंक्शन का नाम
D
The memory address of another variable
किसी अन्य वेरिएबल का मेमोरी एड्रेस
Correct
Solution Breakdown:
-> A pointer variable (declared with `*`, such as `int *p;`) holds the memory address of another variable of the same data type. -> Hence, Option (D) is the correct answer.
-> पॉइंटर एक विशेष वेरिएबल है जो किसी दूसरे वेरिएबल का मेमोरी एड्रेस स्टोर करता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Prev 54 55 56 57 58 Next
ESSENTIAL STUDY KIT

Master Govt Exam PYQs Faster with Recommended Resources

Pair your daily MCQ practice with these educator-picked books, practice sets, and typing gear tailored for this syllabus.

Visit Exam Store
Dell KB216 Wired Multimedia USB Keyboard (Black)
Typing Keyboards Best for Mangal Typing Amazon
Dell KB216 Wired Multimedia USB Keyboard (Black)

Soft chiclet keys and zero lag — the best keyboard for UPP Computer Operator and DSSSB 40+ WPM Hindi/English typing tests.

₹299 ₹999 70% OFF
Affiliate Disclosure: HappyQuiz may earn a small commission on qualifying purchases at no extra cost to you.
Saved to your dashboard!