Which programming construct is represented by the flowchart in the figure below?

नीचे दिए गए चित्र में फ्लोचार्ट किस प्रोग्रामिंग कंस्ट्रक्ट को दिखाता है?

Decision structure - A programming construct that allows a program to choose between different courses of action based on a specified condition. It typically involves using conditional statements such as "if-else" or "switch-case."
Case structure - A programming construct that provides a way to test multiple conditions and execute different code blocks based on which condition is true. It is often used as an alternative to nested if statements.
Loop structure - A programming construct that enables a program to execute instructions repeatedly as long as a certain condition is true. There are several types of loops, including "for" loops, "while" loops, and "do-while" loops.
Sequence structure - A programming construct that represents a series of instructions executed one after another in a predetermined order. It is the simplest type of programming structure and is used in most programs to carry out a set of tasks in a specific order.
The above-given diagram represents the "decision structure".
डिसीजन स्ट्रक्चर - एक प्रोग्रामिंग कंस्ट्रक्ट जो प्रोग्राम को किसी खास कंडीशन के आधार पर अलग-अलग तरह से काम करने का विकल्प देता है। इसमें आमतौर पर "if-else" या "switch-case" जैसे कंडीशनल स्टेटमेंट का इस्तेमाल होता है।
केस स्ट्रक्चर - एक प्रोग्रामिंग कंस्ट्रक्ट जो कई कंडीशन को टेस्ट करने और कौन सी कंडीशन सही है, इसके आधार पर अलग-अलग कोड ब्लॉक को चलाने का तरीका देता है। इसका इस्तेमाल अक्सर नेस्टेड if स्टेटमेंट के विकल्प के तौर पर किया जाता है।
लूप स्ट्रक्चर - एक प्रोग्रामिंग कंस्ट्रक्ट जो प्रोग्राम को तब तक बार-बार इंस्ट्रक्शन चलाने की सुविधा देता है जब तक कोई खास कंडीशन सही रहती है। लूप कई तरह के होते हैं, जैसे "for" लूप, "while" लूप और "do-while" लूप।
सीक्वेंस स्ट्रक्चर - एक प्रोग्रामिंग कंस्ट्रक्ट जो पहले से तय क्रम में एक के बाद एक चलाए जाने वाले इंस्ट्रक्शन की सीरीज़ को दिखाता है। यह सबसे आसान प्रोग्रामिंग स्ट्रक्चर है और इसका इस्तेमाल ज़्यादातर प्रोग्राम में किसी खास क्रम में कई काम पूरे करने के लिए किया जाता है।
ऊपर दिया गया डायग्राम "डिसीजन स्ट्रक्चर" को दिखाता है।
What does the following code output?
int a = 3, b = 3;
cout << (++a == b++);
नीचे दिए गए कोड का आउटपुट क्या है?
int a = 3, b = 3;
cout << (++a == b++);
Key Points
- The code snippet involves pre-increment and post-increment operations on two integer variables a and b.
- Initially, both a and b are set to 3.
- The expression (++a == b++) is evaluated as follows:
- ++a increments a by 1 before the comparison, so a becomes 4.
- b++ increments b by 1 after the comparison, so b remains 3 during the comparison.
- Thus, the comparison (4 == 3) evaluates to false (which is represented as 0 in C++).
मुख्य बातें
• इस कोड स्निपेट में दो इंटीजर वेरिएबल a और b पर प्री-इंक्रीमेंट और पोस्ट-इंक्रीमेंट ऑपरेशन शामिल हैं।
• शुरुआत में, a और b दोनों की वैल्यू 3 सेट की गई है।
• एक्सप्रेशन (++a == b++) का मूल्यांकन इस प्रकार किया जाता है:
o ++a तुलना से पहले a की वैल्यू 1 बढ़ा देता है, इसलिए a की वैल्यू 4 हो जाती है।
o b++ तुलना के बाद b की वैल्यू 1 बढ़ाता है, इसलिए तुलना के दौरान b की वैल्यू 3 ही रहती है।
o इस प्रकार, तुलना (4 == 3) का परिणाम 'फॉल्स' (गलत) होता है (जिसे C++ में 0 के रूप में दिखाया जाता है)।
The output of the following C++ Program is:
#include <stdio.h>
int main (void)
{
int x, *p;
x = 30;
p = x;
print f ("%d", *p);
return 0;
}
नीचे दिए गए C++ प्रोग्राम का आउटपुट है:
#include <stdio.h>
int main (void)
{
int x, *p;
x = 30;
p = x;
print f ("%d", *p);
return 0;
}
Explanation:
Let's analyze the provided C++ program:
#include <stdio.h>
int main (void)
{
int x, *p;
x = 30;
p = x; // Error here
printf("%d", *p);
return 0;
}
In the given code:
- int x, *p; declares an integer x and a pointer to an integer p.
- x = 30; assigns the value 30 to x.
- p = x; attempts to assign the integer value x to the pointer p, which is incorrect.
- In C++, p should be assigned the address of x using p = &x;.
The line printf("%d", *p); attempts to print the value pointed to by p, but since p is not correctly assigned a valid address, this will result in an error.
Because p = x; is invalid in C++ (you cannot assign an integer directly to a pointer without casting or referencing), the program will not compile successfully and will result in a compilation error.
Thus, the correct answer is: Error
व्याख्या:
आइए दिए गए C++ प्रोग्राम का विश्लेषण करें:
#include <stdio.h>
int main (void)
{
int x, *p;
x = 30;
p = x; // यहाँ एरर है
printf("%d", *p);
return 0;
}
दिए गए कोड में:
• int x, *p; एक इंटीजर x और एक इंटीजर पॉइंटर p को डिक्लेयर करता है।
• x = 30; x को 30 वैल्यू असाइन करता है।
• p = x; पॉइंटर p को इंटीजर वैल्यू x असाइन करने की कोशिश करता है, जो गलत है।
• C++ में, p को p = &x; का इस्तेमाल करके x का एड्रेस असाइन किया जाना चाहिए।
लाइन printf("%d", *p); उस वैल्यू को प्रिंट करने की कोशिश करती है जिसे p पॉइंट करता है, लेकिन चूंकि p को सही ढंग से कोई वैलिड एड्रेस असाइन नहीं किया गया है, इसलिए इससे एरर आएगा।
क्योंकि C++ में p = x; इनवैलिड है (आप कास्टिंग या रेफरेंसिंग के बिना सीधे पॉइंटर को इंटीजर असाइन नहीं कर सकते), इसलिए प्रोग्राम सफलतापूर्वक कंपाइल नहीं होगा और कंपाइलेशन एरर देगा।
इस प्रकार, सही उत्तर है: Error
Consider the following array declaration in the 'C' language:
int array 1[] = {2, 3};
int array2[3]={9};
What will be the output of the following print statement?
printf(“%d, %d”, array1 [1], array2 [2]);
'C' भाषा में नीचे दिए गए ऐरे (array) डिक्लेरेशन पर विचार करें:
int array1[] = {2, 3};
int array2[3]={9};
नीचे दिए गए प्रिंट स्टेटमेंट का आउटपुट क्या होगा?
printf(“%d, %d”, array1 [1], array2 [2]);
Key Points
An array is defined as the collection of similar types of data items stored at contiguous memory locations. Arrays are the derived data type in C programming language which can store the primitive type of data such as int, char, double, float, etc. C array is beneficial if you have to store similar elements.
Array can be access i th index at array A,
A[ i ]= i [ A ] = *(A+ i) = *(i + A)
Given that,
int array1[ ] = {2, 3);
int array2[ 3 ] = {9};
printf(“%d, %d”, array1[1], 2[array2]);
array1 is dynamic allocation of {2,3}.
array2 is three memory cells and stores 9 at 0th index of array2.

printf(“%d, %d”, array1[1], 2[array2]);
array1[1]= 1st index at array1 = 3
array2 [2]= 2nd index at array2 = 0
Hence the correct answer is 3, 0.
मुख्य बिंदु
ऐरे को एक-जैसे डेटा आइटम के कलेक्शन के रूप में परिभाषित किया जाता है जो लगातार मेमोरी लोकेशन पर स्टोर होते हैं। ऐरे C प्रोग्रामिंग भाषा में डिराइव्ड डेटा टाइप हैं जो int, char, double, float आदि जैसे प्रिमिटिव टाइप के डेटा को स्टोर कर सकते हैं। C ऐरे तब फायदेमंद होता है जब आपको एक-जैसे एलिमेंट स्टोर करने हों।
ऐरे A के i-वें इंडेक्स को इस तरह एक्सेस किया जा सकता है:
A[ i ]= i [ A ] = *(A+ i) = *(i + A)
दिया गया है,
int array1[ ] = {2, 3};
int array2[ 3 ] = {9};
printf(“%d, %d”, array1[1], 2[array2]);
array1, {2,3} का डायनामिक एलोकेशन है।
array2 में तीन मेमोरी सेल हैं और यह array2 के 0-वें इंडेक्स पर 9 स्टोर करता है।

printf(“%d, %d”, array1[1], 2[array2]);
array1[1]= array1 का पहला इंडेक्स = 3
array2 [2]= array2 का दूसरा इंडेक्स = 0
इसलिए सही उत्तर 3, 0 है।
______ converts a source code to object code.
______ सोर्स कोड को ऑब्जेक्ट कोड में बदलता है।
Explanation -
- Editor - An editor is a software program that allows users to create, modify, and save source code files. It provides a text-based interface for developers to write and edit code, and may include features such as syntax highlighting, code completion, and debugging tools. However, an editor does not convert the source code to object code.
- Loader - A loader is a software program that loads executable files into memory and prepares them for execution. It is responsible for resolving external references, allocating memory, and initializing variables. However, a loader does not convert the source code to object code.
- Linker - A linker is a software program that combines object files generated by a compiler into a single executable file. It resolves external references between different modules, performs symbol resolution, and generates relocation information. However, a linker does not convert the source code to object code.
- Compiler - A compiler is a software program that converts source code written in a high-level programming language into object code that can be executed by a computer. It performs various tasks such as syntax analysis, code optimization, and code generation. The output of a compiler is object code, which can then be linked and loaded to create an executable file. A compiler is an essential tool for software development, as it allows developers to write code in a high-level language and have it translated into machine code that can be executed by the computer.
व्याख्या -
• एडिटर - एडिटर एक सॉफ्टवेयर प्रोग्राम है जो यूज़र्स को सोर्स कोड फ़ाइलें बनाने, उनमें बदलाव करने और उन्हें सेव करने की सुविधा देता है। यह डेवलपर्स को कोड लिखने और एडिट करने के लिए टेक्स्ट-बेस्ड इंटरफ़ेस देता है, और इसमें सिंटैक्स हाइलाइटिंग, कोड पूरा करने (कोड कंप्लीशन) और डीबगिंग टूल्स जैसी सुविधाएँ हो सकती हैं। हालाँकि, एडिटर सोर्स कोड को ऑब्जेक्ट कोड में नहीं बदलता है।
• लोडर - लोडर एक सॉफ्टवेयर प्रोग्राम है जो एग्जीक्यूटेबल फ़ाइलों को मेमोरी में लोड करता है और उन्हें एग्जीक्यूशन (चलने) के लिए तैयार करता है। यह बाहरी रेफरेंस को हल करने, मेमोरी आवंटित करने और वेरिएबल को इनिशियलाइज़ करने का काम करता है। हालाँकि, लोडर सोर्स कोड को ऑब्जेक्ट कोड में नहीं बदलता है।
• लिंकर - लिंकर एक सॉफ्टवेयर प्रोग्राम है जो कंपाइलर द्वारा बनाई गई ऑब्जेक्ट फ़ाइलों को एक ही एग्जीक्यूटेबल फ़ाइल में जोड़ता है। यह अलग-अलग मॉड्यूल के बीच बाहरी रेफरेंस को हल करता है, सिंबल रिज़ॉल्यूशन करता है और रीलोकेशन की जानकारी बनाता है। हालाँकि, लिंकर सोर्स कोड को ऑब्जेक्ट कोड में नहीं बदलता है।
• कंपाइलर - कंपाइलर एक सॉफ्टवेयर प्रोग्राम है जो हाई-लेवल प्रोग्रामिंग भाषा में लिखे गए सोर्स कोड को ऑब्जेक्ट कोड में बदलता है, जिसे कंप्यूटर द्वारा चलाया (एग्जीक्यूट किया) जा सकता है। यह सिंटैक्स एनालिसिस, कोड ऑप्टिमाइज़ेशन और कोड जनरेशन जैसे कई काम करता है। कंपाइलर का आउटपुट ऑब्जेक्ट कोड होता है, जिसे बाद में लिंक और लोड करके एग्जीक्यूटेबल फ़ाइल बनाई जा सकती है। कंपाइलर सॉफ्टवेयर डेवलपमेंट के लिए एक ज़रूरी टूल है, क्योंकि यह डेवलपर्स को हाई-लेवल भाषा में कोड लिखने और उसे मशीन कोड में बदलने की सुविधा देता है, जिसे कंप्यूटर द्वारा चलाया जा सकता है।
The most common use of the one-dimensional array in C is the:
C में वन-डायमेंशनल ऐरे का सबसे आम इस्तेमाल है:
Key Points
- One-dimensional arrays in C are commonly used to store sequences of elements of the same type.
- Among the given options, a string is the most common use of one-dimensional arrays in C.
- A string in C is essentially an array of characters terminated by a null character '\0'.
- This allows for efficient handling of text data in programs, such as storing and manipulating words and sentences.
मुख्य बातें
• C में वन-डायमेंशनल ऐरे का इस्तेमाल आम तौर पर एक ही तरह के एलिमेंट्स के सीक्वेंस को स्टोर करने के लिए किया जाता है।
• दिए गए विकल्पों में से, C में वन-डायमेंशनल ऐरे का सबसे आम इस्तेमाल स्ट्रिंग है।
• C में स्ट्रिंग असल में कैरेक्टर्स का एक ऐरे होता है जो नल कैरेक्टर '\0' पर खत्म होता है।
• इससे प्रोग्राम में टेक्स्ट डेटा को आसानी से हैंडल किया जा सकता है, जैसे शब्दों और वाक्यों को स्टोर करना और उनमें बदलाव करना।
Consider a two dimensional character array A [1:5,2:7]. Assuming row major order of storage determine the address of element A[2][3] if base address is 500.
एक टू-डायमेंशनल कैरेक्टर ऐरे A [1:5,2:7] पर विचार करें। स्टोरेज के 'रो-मेजर ऑर्डर' (row-major order) को मानते हुए, यदि बेस एड्रेस 500 है, तो एलिमेंट A[2][3] का एड्रेस पता करें।
Key Points
- Row-major order means elements are stored row-wise.
- In row-major order, the address of an element A[i][j] in a 2D array can be calculated using the formula:
- Address(A[i][j]) = Base_Address + [(i - Starting_Row) * Number_of_Columns + (j - Starting_Column)]
मुख्य बिंदु
• रो-मेजर ऑर्डर का मतलब है कि एलिमेंट्स को रो (row) के अनुसार स्टोर किया जाता है।
o रो-मेजर ऑर्डर में, 2D ऐरे में किसी एलिमेंट A[i][j] का एड्रेस इस फ़ॉर्मूले का उपयोग करके निकाला जा सकता है:
o Address(A[i][j]) = Base_Address + [(i - Starting_Row) * Number_of_Columns + (j - Starting_Column)]
Which one of these is not a popular programming language for which IDEs are available?
इनमें से कौन सी एक लोकप्रिय प्रोग्रामिंग भाषा नहीं है जिसके लिए IDE उपलब्ध हैं?
Solution
HTML (HyperText Markup Language): It is not a programming language, but a markup language used to structure content on the web. While there are text editors and integrated development environments (IDES) available for editing HTML code, it is not a programming language and does not require a compiler or interpreter.
On the other hand, Python, Java, and C++ are popular programming languages for which there are many IDEs available.
Python: Is a high-level, interpreted programming language used for web development, data analysis, and scientific computing.
Java: Is a popular programming language used for developing applications and is used widely for enterprise-level development.
C++: Is a high-performance programming language used for system-level programming, gaming, and software development.
There are many popular IDEs available for each of these languages, including PyCharm, Eclipse, and Visual Studio for Python, Java, and C++, respectively.
Hence, the correct answer is Option 4.
समाधान
HTML (HyperText Markup Language): यह कोई प्रोग्रामिंग भाषा नहीं है, बल्कि एक मार्कअप भाषा है जिसका उपयोग वेब पर कंटेंट को व्यवस्थित करने के लिए किया जाता है। हालाँकि HTML कोड को एडिट करने के लिए टेक्स्ट एडिटर और इंटीग्रेटेड डेवलपमेंट एनवायरनमेंट (IDE) उपलब्ध हैं, लेकिन यह कोई प्रोग्रामिंग भाषा नहीं है और इसके लिए कंपाइलर या इंटरप्रेटर की आवश्यकता नहीं होती है।
दूसरी ओर, Python, Java और C++ लोकप्रिय प्रोग्रामिंग भाषाएँ हैं जिनके लिए कई IDE उपलब्ध हैं।
Python: यह एक हाई-लेवल, इंटरप्रिटेड प्रोग्रामिंग भाषा है जिसका उपयोग वेब डेवलपमेंट, डेटा एनालिसिस और साइंटिफिक कंप्यूटिंग के लिए किया जाता है।
Java: यह एक लोकप्रिय प्रोग्रामिंग भाषा है जिसका उपयोग एप्लिकेशन विकसित करने के लिए किया जाता है और इसका बड़े पैमाने पर एंटरप्राइज़-लेवल डेवलपमेंट के लिए उपयोग किया जाता है।
C++: यह एक हाई-परफॉर्मेंस प्रोग्रामिंग भाषा है जिसका उपयोग सिस्टम-लेवल प्रोग्रामिंग, गेमिंग और सॉफ्टवेयर डेवलपमेंट के लिए किया जाता है।
इनमें से प्रत्येक भाषा के लिए कई लोकप्रिय IDE उपलब्ध हैं, जिनमें क्रमशः Python, Java और C++ के लिए PyCharm, Eclipse और Visual Studio शामिल हैं।
इसलिए, सही उत्तर विकल्प 4 है।
In C programming body of a switch statement must consist of:
C प्रोग्रामिंग में, स्विच स्टेटमेंट की बॉडी में ये चीज़ें होनी चाहिए:
A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.
Syntax
switch(expression) {
case constant-expression :
statement(s); break; /* optional */
default : /* Optional */
statement(s);
}
स्विच स्टेटमेंट किसी वेरिएबल की वैल्यूज़ की लिस्ट के साथ समानता (equality) की जाँच करने की सुविधा देता है। हर वैल्यू को 'केस' कहा जाता है, और जिस वेरिएबल पर स्विच किया जा रहा है, उसकी जाँच हर स्विच केस के लिए की जाती है।
सिंटैक्स
switch(expression) {
case constant-expression :
statement(s); break; /* वैकल्पिक */
default : /* वैकल्पिक */
statement(s);
}
Use of functions -
A) Enhances logical clarity of program
B) Makes debugging easier
C) Helps avoid repeating of statements
फ़ंक्शंस का इस्तेमाल -
A) प्रोग्राम की लॉजिकल क्लैरिटी (तार्किक स्पष्टता) को बढ़ाता है
B) डीबगिंग को आसान बनाता है
C) स्टेटमेंट्स को बार-बार लिखने से बचने में मदद करता है
Solution
The correct answer is (A), (B), (C) are correct
Key Points
A) Enhances the logical clarity of programs:
-
- Functions allow a programmer to segment large, complex programming tasks into smaller, more manageable subtasks.
- When you put code into a function, you’re signaling to others that this is an important operation that we might want to use again.
- It enhances readability and understanding of the code.
B) Makes debugging easier:
-
- By breaking the program into functions, if an error occurs, you'll have a better idea of where to look.
- The error is likely to be contained within the function that was just executed.
- This makes your program easier to debug, since you don't have to understand the entire program at once.
C) Helps avoid repeating of statements:
-
- Functions allow for reusability of code. Instead of repeating the same lines of code multiple times, you can encapsulate them into a function and call the function whenever those lines of code need to be executed again.
- This reduces code repetition and makes the program more organized and efficient.
So, all A, B, C statements are correct regarding the use of functions in programming.
समाधान
सही जवाब है (A), (B), (C) सही हैं
मुख्य बातें
A) प्रोग्राम की लॉजिकल क्लैरिटी को बढ़ाता है:
o फ़ंक्शंस प्रोग्रामर को बड़े, जटिल प्रोग्रामिंग कार्यों को छोटे, आसानी से संभाले जा सकने वाले सब-टास्क्स में बांटने की सुविधा देते हैं।
o जब आप कोड को किसी फ़ंक्शन में डालते हैं, तो आप दूसरों को यह संकेत देते हैं कि यह एक महत्वपूर्ण ऑपरेशन है जिसे हम शायद दोबारा इस्तेमाल करना चाहें।
o यह कोड को पढ़ने और समझने में आसान बनाता है।
B) डीबगिंग को आसान बनाता है:
o प्रोग्राम को फ़ंक्शंस में बांटने से, अगर कोई एरर (त्रुटि) आती है, तो आपको बेहतर अंदाज़ा हो जाता है कि कहां देखना है।
o इस बात की संभावना होती है कि एरर उसी फ़ंक्शन के अंदर हो जिसे अभी-अभी चलाया गया था।
o इससे आपके प्रोग्राम को डीबग करना आसान हो जाता है, क्योंकि आपको एक ही बार में पूरे प्रोग्राम को समझने की ज़रूरत नहीं पड़ती।
C) स्टेटमेंट्स को बार-बार लिखने से बचने में मदद करता है:
o फ़ंक्शंस कोड के दोबारा इस्तेमाल (रीयूज़ेबिलिटी) की सुविधा देते हैं। कोड की उन्हीं लाइनों को कई बार दोहराने के बजाय, आप उन्हें एक फ़ंक्शन में रख सकते हैं और जब भी उन लाइनों को दोबारा चलाने की ज़रूरत हो, तो उस फ़ंक्शन को कॉल कर सकते हैं।
o इससे कोड का दोहराव कम होता है और प्रोग्राम ज़्यादा व्यवस्थित और कुशल बनता है।
इसलिए, प्रोग्रामिंग में फ़ंक्शंस के इस्तेमाल के संबंध में A, B, C सभी बातें सही हैं।


