[Programming MCQS ]
झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।
[ Programming MCQS ]
Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
31. Integer print करने के लिए format specifier क्या है?
[A] %d
[B] %i
[C] %int
[D] %integer
31. The format specifier for printing an integer in C is:
[A] %d
[B] %i
[C] %int
[D] %integer
सही उत्तर: A
व्याख्या: %d integer values print करने के लिए उपयोग होता है।
Correct Answer: A
Explanation: %d is used to print integers.
32. निम्न में से कौन valid data type नहीं है?
[A] float
[B] boolean
[C] char
[D] double
32. Which of the following is NOT a valid data type in C?
[A] float
[B] boolean
[C] char
[D] double
सही उत्तर: B
व्याख्या: Standard C में boolean मूल data type नहीं है।
Correct Answer: B
Explanation: boolean is not a primary data type in standard C.
33. printf function का उपयोग किसलिए किया जाता है?
[A] Taking input from the user
[B] Displaying output to the user
[C] Declaring variables
[D] Performing arithmetic operations
33. The “printf” function is used for:
[A] Taking input from the user
[B] Displaying output to the user
[C] Declaring variables
[D] Performing arithmetic operations
सही उत्तर: B
व्याख्या: printf output display करने के लिए उपयोग होता है।
Correct Answer: B
Explanation: printf is used to display output.
34. Input और output functions के लिए कौन सी library उपयोग होती है?
[A] stdlib
[B] math
[C] iostream
[D] stdio
34. Which library is used for input and output functions in C?
[A] stdlib
[B] math
[C] iostream
[D] stdio
सही उत्तर: D
व्याख्या: stdio.h standard input-output library है।
Correct Answer: D
Explanation: stdio.h is the standard I/O library.
35. 32-bit system में int data type का size कितना होता है?
[A] 4 bytes
[B] 2 bytes
[C] 8 bytes
[D] Depends on the compiler
35. What is the size of the “int” data type on a typical 32-bit system?
[A] 4 bytes
[B] 2 bytes
[C] 8 bytes
[D] Depends on the compiler
सही उत्तर: A
व्याख्या: 32-bit system में int सामान्यतः 4 bytes का होता है।
Correct Answer: A
Explanation: int is typically 4 bytes on 32-bit systems.
36. malloc और free functions के लिए कौन सी header file शामिल करनी चाहिए?
[A] stdio.h
[B] malloc.h
[C] memory.h
[D] stdlib.h
36. Which header file should be included to use functions like “malloc” and “free”?
[A] stdio.h
[B] malloc.h
[C] memory.h
[D] stdlib.h
सही उत्तर: D
व्याख्या: Dynamic memory allocation functions stdlib.h में होती हैं।
Correct Answer: D
Explanation: malloc and free are declared in stdlib.h.
37. scanf function का उपयोग किसलिए किया जाता है?
[A] Printing output
[B] Reading input
[C] Allocating memory
[D] Declaring variables
37. The “scanf” function is used for:
[A] Printing output
[B] Reading input
[C] Allocating memory
[D] Declaring variables
सही उत्तर: B
व्याख्या: scanf user से input लेने के लिए उपयोग होता है।
Correct Answer: B
Explanation: scanf is used for reading input.
38. C में break statement का उपयोग किसलिए किया जाता है?
[A] Exit the program
[B] End the current loop iteration
[C] Skip a loop iteration
[D] Define a new function
38. In C, the “break” statement is used to:
[A] Exit the program
[B] End the current loop iteration
[C] Skip a loop iteration
[D] Define a new function
सही उत्तर: B
व्याख्या: break loop या switch से बाहर निकलने के लिए उपयोग होता है।
Correct Answer: B
Explanation: break is used to terminate the current loop or switch.
39. निम्न में से कौन सा valid loop नहीं है?
[A] for loop
[B] while loop
[C] do-while loop
[D] if loop
39. Which of the following is NOT a valid loop in C?
[A] for loop
[B] while loop
[C] do-while loop
[D] if loop
सही उत्तर: D
व्याख्या: if loop नहीं बल्कि conditional statement है।
Correct Answer: D
Explanation: if is a conditional statement, not a loop.
40. C में ternary operator किस symbol द्वारा दर्शाया जाता है?
[A] ::
[B] ?
[C] #
[D] ->
40. The ternary operator in C is represented as:
[A] ::
[B] ?
[C] #
[D] ->
सही उत्तर: B
व्याख्या: Ternary operator condition ? true:false syntax उपयोग करता है।
Correct Answer: B
Explanation: Ternary operator uses ? symbol.