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

Govt Exam PYQs

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

Timed Quiz
Newest Classic 25 Qs
No Questions Match Your Filter

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

Question 2001 NEW
Most Important MEDIUM
Which of the following statements is INCORRECT about `inline` functions in C++?
C++ में `inline` फंक्शंस के बारे में निम्नलिखित में से कौन सा कथन गलत है?
A
They save the overhead of a function call
वे फंक्शन कॉल के ओवरहेड को बचाते हैं
B
Their code is substituted directly at the point of call
उनका कोड सीधे कॉल किए गए स्थान पर जुड़ जाता है
C
They are generally very large and complicated functions
वे सामान्यतः बहुत बड़े और जटिल फंक्शन होते हैं
Correct
D
They can speed up execution for small, frequently called functions
वे छोटे और बार-बार कॉल होने वाले फंक्शंस का निष्पादन तेज़ कर सकते हैं
Solution Breakdown:
-> `inline` functions should always be very small and simple (1–3 lines); making large functions inline bloats the executable size and is usually ignored by the compiler. -> Hence, Option (C) is the correct answer.
-> `inline` फंक्शन हमेशा छोटे और सरल होने चाहिए; बड़े और जटिल फंक्शंस को इनलाइन बनाना गलत है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 2002 NEW
Most Important MEDIUM
What is the purpose of "Virtual Inheritance" in C++?
C++ में "वर्चुअल इनहेरिटेंस" का मुख्य उद्देश्य क्या होता है?
A
To allow private members to be accessed publicly
प्राइवेट सदस्यों को पब्लिकली एक्सेस करने के लिए
B
To avoid creating multiple duplicate copies of a common base class in a derived class (solving the Diamond Problem)
डिराइव्ड क्लास में एक ही बेस क्लास की कई डुप्लीकेट कॉपियां बनने से रोकने के लिए (डायमंड प्रॉब्लम हल करने हेतु)
Correct
C
To speed up loops
लूप्स को तेज़ करने के लिए
D
To delete objects automatically
ऑब्जेक्ट्स को अपने आप डिलीट करने के लिए
Solution Breakdown:
-> In Hybrid/Multiple inheritance, if classes B and C both inherit from A, and D inherits from both B and C, Virtual Inheritance ensures D receives only ONE shared copy of A. -> Hence, Option (B) is the correct answer.
-> वर्चुअल इनहेरिटेंस मल्टीपल इनहेरिटेंस में आने वाली 'डायमंड प्रॉब्लम' को हल करता है ताकि चाइल्ड क्लास में बेस क्लास की केवल एक ही कॉपी रहे। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2003 NEW
Most Important MEDIUM
In C++, what makes a class an "Abstract Class"?
C++ में किसी क्लास को "एब्स्ट्रैक्ट क्लास" क्या बनाता है?
A
Having at least one `private` variable
कम से कम एक प्राइवेट वेरिएबल होना
B
Having at least one Pure Virtual Function (declared with `= 0`)
कम से कम एक प्योर वर्चुअल फंक्शन (`= 0` के साथ घोषित) होना
Correct
C
Having no constructor
कोई कंस्ट्रक्टर न होना
D
Having only `static` methods
केवल स्टैटिक मेथड्स होना
Solution Breakdown:
-> A Pure Virtual Function (e.g., `virtual void draw() = 0;`) makes its containing class an Abstract Class in C++, meaning you cannot create objects directly from it. -> Hence, Option (B) is the correct answer.
-> C++ में कम से कम एक प्योर वर्चुअल फंक्शन (`= 0`) वाली क्लास को एब्स्ट्रैक्ट क्लास कहा जाता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2004 NEW
Most Important MEDIUM
Which constructor is automatically provided by the C++ compiler if the programmer does NOT define any constructor in a class?
यदि प्रोग्रामर किसी क्लास में कोई कंस्ट्रक्टर परिभाषित नहीं करता, तो C++ कंपाइलर द्वारा कौन सा कंस्ट्रक्टर स्वतः प्रदान किया जाता है?
A
Copy Constructor
कॉपी कंस्ट्रक्टर
B
Parameterized Constructor
पैरामीटराइज़्ड कंस्ट्रक्टर
C
Default Constructor
डिफ़ॉल्ट कंस्ट्रक्टर
Correct
D
Virtual Constructor
वर्चुअल कंस्ट्रक्टर
Solution Breakdown:
-> When no user-defined constructor exists, the C++ compiler automatically generates an implicit Default Constructor (taking zero arguments) so objects can still be instantiated. -> Hence, Option (C) is the correct answer.
-> यदि क्लास में कोई कंस्ट्रक्टर न लिखा जाए, तो कंपाइलर अपने आप एक डिफ़ॉल्ट कंस्ट्रक्टर बना देता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 2005 NEW
Most Important EASY
Which operator is used in C++ to define a class member function OUTSIDE the class definition?
C++ में क्लास की परिभाषा के बाहर किसी क्लास के मेंबर फंक्शन को परिभाषित करने के लिए किस ऑपरेटर का उपयोग किया जाता है?
A
`:`
`:`
B
`::`
`::`
Correct
C
`#`
`#`
D
`->`
`->`
Solution Breakdown:
-> The Scope Resolution Operator (`::`) links a member function definition outside the class back to its class (e.g., `void Student::display() { ... }`). -> Hence, Option (B) is the correct answer.
-> स्कोप रिज़ॉल्यूशन ऑपरेटर (`::`) का उपयोग क्लास के बाहर मेंबर फंक्शन को परिभाषित करने के लिए किया जाता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2006 NEW
Most Important EASY
How many Access Specifiers are available inside a C++ class?
C++ क्लास के अंदर कुल कितने एक्सेस स्पेसिफायर्स उपलब्ध होते हैं?
A
2
2
B
3
3
Correct
C
4
4
D
5
5
Solution Breakdown:
-> C++ provides exactly 3 access specifiers for class members: `public` (accessible everywhere), `private` (accessible only inside the class), and `protected` (accessible inside the class and derived subclasses). -> Hence, Option (B) is the correct answer.
-> C++ में कुल 3 एक्सेस स्पेसिफायर्स होते हैं: `public`, `private` और `protected`। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2007 NEW
Most Important EASY
How do `struct` (structures) and `class` (classes) differ by default in C++?
C++ में `struct` (स्ट्रक्चर) और `class` (क्लास) डिफ़ॉल्ट रूप से एक-दूसरे से कैसे भिन्न होते हैं?
A
In structures, members are `private` by default; in classes, they are `public` by default
स्ट्रक्चर में सदस्य डिफ़ॉल्ट रूप से प्राइवेट होते हैं; क्लास में पब्लिक होते हैं
B
In structures, members are `public` by default; in classes, they are `private` by default
स्ट्रक्चर में सदस्य डिफ़ॉल्ट रूप से पब्लिक होते हैं; क्लास में प्राइवेट होते हैं
Correct
C
Structures cannot contain functions
स्ट्रक्चर में फंक्शन नहीं हो सकते
D
Classes cannot contain variables
क्लास में वेरिएबल नहीं हो सकते
Solution Breakdown:
-> In C++, both `struct` and `class` can hold data and functions; the only fundamental default difference is member visibility: `public` for `struct` and `private` for `class`. -> Hence, Option (B) is the correct answer.
-> C++ में `struct` के सदस्य डिफ़ॉल्ट रूप से `public` और `class` के सदस्य डिफ़ॉल्ट रूप से `private` होते हैं। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2008 NEW
Most Important EASY
In C++, what does `cout` stand for?
C++ में `cout` का पूर्ण रूप क्या होता है?
A
Class Output
क्लास आउटपुट
B
Common Output
कॉमन आउटपुट
C
Character Output
कैरेक्टर आउटपुट
Correct
D
Console Outer
कंसोल आउटर
Solution Breakdown:
-> In C++, `cout` stands for "Character Output" (defined in `<iostream>`) and is used with the insertion operator (`<<`) to display output on the standard screen. -> Hence, Option (C) is the correct answer.
-> C++ में `cout` का अर्थ 'कैरेक्टर आउटपुट' होता है, जिसका उपयोग `<<` ऑपरेटर के साथ स्क्रीन पर आउटपुट दिखाने के लिए किया जाता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 2009 NEW
Most Important EASY
Which programming approach is primarily followed by C++?
C++ मुख्य रूप से किस प्रोग्रामिंग दृष्टिकोण का पालन करता है?
A
Top-Down Approach
टॉप-डाउन दृष्टिकोण
B
Left-Right Approach
लेफ्ट-राइट दृष्टिकोण
C
Bottom-Up Approach
बॉटम-अप दृष्टिकोण
Correct
D
Random Approach
रैंडम दृष्टिकोण
Solution Breakdown:
-> Object-Oriented Programming languages like C++ follow a Bottom-Up approach, where basic building blocks (classes and objects) are designed first and combined to build the complete system. -> Hence, Option (C) is the correct answer.
-> C++ जैसी ऑब्जेक्ट-ओरिएंटेड भाषाएँ बॉटम-अप दृष्टिकोण का पालन करती हैं, जिसमें पहले क्लासेस और ऑब्जेक्ट्स बनाकर उन्हें पूरे सिस्टम में जोड़ा जाता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 2010 NEW
Most Important EASY
Who originally created the C++ programming language in the early 1980s at AT&T Bell Laboratories?
1980 के दशक की शुरुआत में AT&T बेल लैबोरेटरीज़ में C++ प्रोग्रामिंग भाषा का आविष्कार किसने किया था?
A
Dennis Ritchie
डेनिस रिची
B
Bjarne Stroustrup
ब्योर्न स्ट्राउस्ट्रप
Correct
C
James Gosling
जेम्स गोसलिंग
D
Ken Thompson
केन थॉम्पसन
Solution Breakdown:
-> Bjarne Stroustrup developed C++ (originally called "C with Classes") at Bell Labs starting in 1979–1980 as an object-oriented extension to the C language. -> Hence, Option (B) is the correct answer.
-> ब्योर्न स्ट्राउस्ट्रप ने 1979–1980 में बेल लैब्स में C के ऑब्जेक्ट-ओरिएंटेड विस्तार के रूप में C++ का विकास किया था। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2011 NEW
📜 PYQs EASY
Which statement best explains why C is still called the "Mother of Modern Programming Languages"?
कौन सा कथन सबसे अच्छी तरह बताता है कि C को आज भी "आधुनिक प्रोग्रामिंग भाषाओं की जननी" क्यों कहा जाता है?
A
Because C directly inspired the syntax, concepts, and compilers of C++, Java, C#, Python, and major operating systems like UNIX, Linux, and Windows
क्योंकि C ने C++, Java, C#, Python के सिंटैक्स और कंपाइलर तथा UNIX, Linux और Windows जैसे प्रमुख ऑपरेटिंग सिस्टम की नींव रखी
Correct
B
Because C is the only language used for websites
क्योंकि C वेबसाइटों के लिए उपयोग होने वाली एकमात्र भाषा है
C
Because C does not need a compiler
क्योंकि C को कंपाइलर की ज़रूरत नहीं होती
D
Because C was invented in 2020
क्योंकि C का आविष्कार 2020 में हुआ था
Solution Breakdown:
-> Most modern compilers, interpreters (like CPython), and OS kernels are still written in C due to its unmatched speed and hardware control. -> Hence, Option (A) is the correct answer.
-> अपनी अत्यधिक गति और हार्डवेयर नियंत्रण के कारण आज भी अधिकांश OS कर्नेल और कंपाइलर C में लिखे जाते हैं। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 2012 NEW
📜 PYQs MEDIUM
Match the C Function with its Header File: 1. `printf()` — (a) `<math.h>` 2. `malloc()` — (b) `<stdio.h>` 3. `strlen()` — (c) `<stdlib.h>` 4. `sqrt()` — (d) `<string.h>`
C फंक्शन को उसकी हेडर फाइल से सुमेलित करें: 1. `printf()` — (a) `<math.h>` 2. `malloc()` — (b) `<stdio.h>` 3. `strlen()` — (c) `<stdlib.h>` 4. `sqrt()` — (d) `<string.h>`
A
1-a, 2-b, 3-c, 4-d
1-a, 2-b, 3-c, 4-d
B
1-b, 2-c, 3-d, 4-a
1-b, 2-c, 3-d, 4-a
Correct
C
1-b, 2-d, 3-c, 4-a
1-b, 2-d, 3-c, 4-a
D
1-c, 2-b, 3-d, 4-a
1-c, 2-b, 3-d, 4-a
Solution Breakdown:
-> Correct matches: `printf()` (`<stdio.h>`), `malloc()` (`<stdlib.h>`), `strlen()` (`<string.h>`), `sqrt()` (`<math.h>`). -> Hence, Option (B) is the correct answer.
-> सही मिलान: 1-b, 2-c, 3-d, 4-a। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2013 NEW
📜 PYQs MEDIUM
Match the C Storage Class with its Key Behavior: 1. `auto` — (a) Default class for local variables 2. `static` — (b) Requests storage inside a fast CPU register 3. `register` — (c) Declares a global variable defined in another file 4. `extern` — (d) Retains local variable value across function calls
C स्टोरेज क्लास को उसके मुख्य व्यवहार से सुमेलित करें: 1. `auto` — (a) लोकल वेरिएबल्स की डिफ़ॉल्ट क्लास 2. `static` — (b) तेज़ CPU रजिस्टर में स्टोरेज का अनुरोध 3. `register` — (c) किसी अन्य फाइल में परिभाषित ग्लोबल वेरिएबल को दर्शाना 4. `extern` — (d) फंक्शन कॉल्स के बीच लोकल वेरिएबल का मान बनाए रखना
A
1-a, 2-d, 3-b, 4-c
1-a, 2-d, 3-b, 4-c
Correct
B
1-a, 2-b, 3-c, 4-d
1-a, 2-b, 3-c, 4-d
C
1-b, 2-d, 3-a, 4-c
1-b, 2-d, 3-a, 4-c
D
1-d, 2-a, 3-b, 4-c
1-d, 2-a, 3-b, 4-c
Solution Breakdown:
-> Correct matches: `auto` (Default local), `static` (Retains value), `register` (CPU register), `extern` (External global variable). -> Hence, Option (A) is the correct answer.
-> सही मिलान: 1-a, 2-d, 3-b, 4-c। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 2014 NEW
📜 PYQs EASY
Which escape sequence in C moves the cursor to the next horizontal tab stop?
C भाषा में कौन सा एस्केप सीक्वेंस कर्सर को अगले हॉरिजॉन्टल टैब स्टॉप पर ले जाता है?
A
`\n`
`\n`
B
`\r`
`\r`
C
`\v`
`\v`
D
`\t`
`\t`
Correct
Solution Breakdown:
-> `\t` inserts a horizontal tab space, ` -> ` inserts a new line, and `\r` performs a carriage return. -> Hence, Option (D) is the correct answer.
-> `\t` हॉरिजॉन्टल टैब स्पेस के लिए और ` -> ` नई लाइन के लिए उपयोग होता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 2015 NEW
📜 PYQs MEDIUM
What is the output of the following C loop? for (int i = 0; i < 6; ++i) printf("%d", i & 1);
उपरोक्त C लूप का आउटपुट क्या होगा?
A
`111111`
`111111`
B
`000000`
`000000`
C
`010101`
`010101`
Correct
D
`101010`
`101010`
Solution Breakdown:
-> `i & 1` checks the last binary bit of `i` (`0` for even, `1` for odd). For `i = 0, 1, 2, 3, 4, 5`, it prints `010101`. -> Hence, Option (C) is the correct answer.
-> `i & 1` सम संख्या के लिए `0` और विषम संख्या के लिए `1` देता है, अतः `0` से `5` तक `010101` प्रिंट होगा। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 2016 NEW
📜 PYQs MEDIUM
Evaluate the following statements about C: (I) `struct` and `union` are both user-defined data types in C. (II) A `union` can have many members, and all of them can hold separate values simultaneously.
C के बारे में निम्नलिखित कथनों का मूल्यांकन करें: (I) `struct` और `union` दोनों C में यूज़र-डिफाइंड डेटा टाइप हैं। (II) एक `union` में कई सदस्य हो सकते हैं, और वे सभी एक ही समय में अलग-अलग मान स्टोर रख सकते हैं।
A
Both (I) and (II) are true
(I) और (II) दोनों सत्य हैं
B
Only (I) is true
केवल (I) सत्य है
Correct
C
Only (II) is true
केवल (II) सत्य है
D
Neither (I) nor (II) is true
न तो (I) और न ही (II) सत्य है
Solution Breakdown:
-> Statement (I) is true. Statement (II) is false because union members share the same memory location, so only ONE member can hold a valid value at a time. -> Hence, Option (B) is the correct answer.
-> कथन (I) सत्य है, जबकि यूनियन में एक समय पर केवल एक ही सदस्य मान रख सकता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2017 NEW
📜 PYQs EASY
What is the index of the VERY FIRST element of any array in C?
C भाषा में किसी भी एरे के सबसे पहले तत्व का इंडेक्स क्या होता है?
A
`0`
`0`
Correct
B
`1`
`1`
C
`-1`
`-1`
D
`100`
`100`
Solution Breakdown:
-> C uses 0-based indexing: for an array of `N` elements, valid indices run from `0` to `N - 1`. -> Hence, Option (A) is the correct answer.
-> C में एरे की इंडेक्सिंग हमेशा `0` से शुरू होकर `N - 1` तक जाती है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 2018 NEW
📜 PYQs MEDIUM
What is the purpose of the `typedef` keyword in C?
C भाषा में `typedef` कीवर्ड का क्या उद्देश्य होता है?
A
To delete a data type
किसी डेटा टाइप को डिलीट करना
B
To convert float to int
फ्लोट को पूर्णांक में बदलना
C
To allocate heap memory
हीप मेमोरी आवंटित करना
D
To create a new, shorter alias (alternative name) for an existing data type
किसी मौजूदा डेटा टाइप के लिए एक नया, छोटा उपनाम (Alias) बनाना
Correct
Solution Breakdown:
-> For example, `typedef unsigned int uint;` lets programmers write `uint` instead of `unsigned int`, improving code readability. -> Hence, Option (D) is the correct answer.
-> `typedef` किसी लंबे डेटा टाइप (जैसे `struct` या `unsigned int`) को छोटा और आसान नाम देने के काम आता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 2019 NEW
📜 PYQs MEDIUM
In C, which statement is FALSE regarding functions?
C भाषा में फंक्शंस के संबंध में निम्नलिखित में से कौन सा कथन असत्य है?
A
A function prototype specifies its name, return type, and parameters
फंक्शन प्रोटोटाइप फंक्शन का नाम, रिटर्न टाइप और पैरामीटर बताता है
B
Arguments passed during a function call are called actual parameters
फंक्शन कॉल के समय भेजे गए मान वास्तविक पैरामीटर कहलाते हैं
C
Every function definition in C MUST contain a `return` statement
C में प्रत्येक फंक्शन की परिभाषा में `return` स्टेटमेंट होना अनिवार्य है
Correct
D
A `void` function does not return a value
`void` फंक्शन कोई मान रिटर्न नहीं करता
Solution Breakdown:
-> Functions declared with a `void` return type do NOT require a `return` statement. Therefore, statement (C) is false. -> Hence, Option (C) is the correct answer.
-> `void` रिटर्न टाइप वाले फंक्शन में `return` स्टेटमेंट लिखना अनिवार्य नहीं है, इसलिए कथन (C) असत्य है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 2020 NEW
📜 PYQs EASY
Which function is the mandatory entry point where execution ALWAYS begins in every standard C program?
प्रत्येक मानक C प्रोग्राम में निष्पादन हमेशा किस अनिवार्य फंक्शन से शुरू होता है?
A
`start()`
`start()`
B
`main()`
`main()`
Correct
C
`init()`
`init()`
D
`begin()`
`begin()`
Solution Breakdown:
-> Every executable C program must contain exactly one `main()` function; the OS transfers control directly to `main()` when the program launches. -> Hence, Option (B) is the correct answer.
-> हर C प्रोग्राम का निष्पादन हमेशा `main()` फंक्शन से ही शुरू होता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2021 NEW
📜 PYQs MEDIUM
What will be the output of the following C code? int b = 1, c = 5; int a = 0 - (++b) + c++; printf("%d, %d, %d", a, b, c);
उपरोक्त C कोड का आउटपुट क्या होगा?
A
`3, 2, 6`
`3, 2, 6`
Correct
B
`4, 2, 6`
`4, 2, 6`
C
`3, 1, 5`
`3, 1, 5`
D
`4, 1, 5`
`4, 1, 5`
Solution Breakdown:
-> Pre-increment `++b` increments `b` to `2` BEFORE use. Post-increment `c++` uses `5` FIRST and then increments `c` to `6`. Thus `a = 0 - 2 + 5 = 3`, `b = 2`, `c = 6`. -> Hence, Option (A) is the correct answer.
-> `++b` पहले बढ़कर `2` हो जाता है और `c++` पहले `5` उपयोग होकर बाद में `6` बनता है, अतः `a = 0 - 2 + 5 = 3`। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 2022 NEW
📜 PYQs MEDIUM
What is the only integer constant that can be directly assigned to a pointer variable in C without typecasting?
C भाषा में वह एकमात्र पूर्णांक कॉन्स्टेंट कौन सा है जिसे बिना टाइपकास्टिंग के सीधे किसी पॉइंटर वेरिएबल को सौंपा जा सकता है?
A
`1`
`1`
B
`-1`
`-1`
C
`100`
`100`
D
`0` (representing `NULL`)
`0` (representing `NULL`)
Correct
Solution Breakdown:
-> Assigning `0` to a pointer initializes it as a `NULL` pointer, indicating that it does not point to any valid memory address. -> Hence, Option (D) is the correct answer.
-> किसी पॉइंटर को सीधे `0` (`NULL`) सौंपा जा सकता है, जिसका अर्थ है कि वह किसी वैध एड्रेस की ओर संकेत नहीं कर रहा है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 2023 NEW
📜 PYQs MEDIUM
What is a "Dangling Pointer" in C programming?
C प्रोग्रामिंग में "डैंगलिंग पॉइंटर" क्या होता है?
A
A pointer initialized to `NULL`
`NULL` से इनिशियलाइज़ किया गया पॉइंटर
B
A pointer to an integer
पूर्णांक की ओर संकेत करने वाला पॉइंटर
C
A pointer that still points to a memory location that has already been freed or deallocated
एक ऐसा पॉइंटर जो अभी भी उस मेमोरी स्थान की ओर संकेत कर रहा है जिसे पहले ही मुक्त (`free`) किया जा चुका है
Correct
D
A syntax error
एक सिंटैक्स एरर
Solution Breakdown:
-> Accessing a dangling pointer leads to undefined behavior or crashes; setting `ptr = NULL;` right after `free(ptr);` prevents this bug. -> Hence, Option (C) is the correct answer.
-> मुक्त की जा चुकी मेमोरी की ओर संकेत करने वाला पॉइंटर 'डैंगलिंग पॉइंटर' कहलाता है, जिससे प्रोग्राम क्रैश हो सकता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 2024 NEW
📜 PYQs EASY
In C, what does `strcmp(str1, str2)` return when both strings `str1` and `str2` are completely IDENTICAL?
C भाषा में, जब दोनों स्ट्रिंग्स `str1` और `str2` बिल्कुल समान हों, तो `strcmp(str1, str2)` क्या रिटर्न करता है?
A
`1`
`1`
B
`0`
`0`
Correct
C
`-1`
`-1`
D
`True`
`True`
Solution Breakdown:
-> `strcmp()` compares two strings lexicographically and returns `0` if they are equal, a negative value if `str1 < str2`, and a positive value if `str1 > str2`. -> Hence, Option (B) is the correct answer.
-> दोनों स्ट्रिंग्स के बिल्कुल समान होने पर `strcmp()` शून्य (`0`) लौटाता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 2025 NEW
📜 PYQs EASY
Which header file in C provides string manipulation functions like `strlen()`, `strcpy()`, and `strcmp()`?
C भाषा में `strlen()`, `strcpy()` और `strcmp()` जैसे स्ट्रिंग फंक्शंस किस हेडर फाइल में होते हैं?
A
`<string.h>`
`<string.h>`
Correct
B
`<stdio.h>`
`<stdio.h>`
C
`<math.h>`
`<math.h>`
D
`<stdlib.h>`
`<stdlib.h>`
Solution Breakdown:
-> `<string.h>` contains all standard C string functions, while `<math.h>` provides mathematical functions like `sqrt()` and `pow()`. -> Hence, Option (A) is the correct answer.
-> सभी स्ट्रिंग फंक्शंस `<string.h>` हेडर फाइल में परिभाषित होते हैं। -> इसलिए विकल्प (A) बिल्कुल सही है।
Prev 79 80 81 82 83 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!