पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 19 के उत्तर और हल FliQi Question Bank app में।
भाषा
प्रश्न 1उत्तर + हल
Loader किसका भाग है?
Loader is a part of:
ACompiler
BAssembler
COperating System
DInterpreter
सही उत्तर / Answer: (C)
हल / Solution
जब हम Test.exe को चलाते हैं, तो operating system उसे disk से RAM में लाता है। यह काम OS का एक हिस्सा करता है, जिसे loader कहते हैं। वह प्रोग्राम को memory देता है और फिर उसे चलाना शुरू करता है। Compiler और assembler फ़ाइलें बनाते हैं, उन्हें चलाते नहीं। उनका काम .exe बनने से पहले ख़त्म हो जाता है। Interpreter भी OS का भाग नहीं है, वह एक अलग प्रोग्राम है।
When we run Test.exe, the operating system brings it from the disk into RAM. A part of the OS called the loader does this work. It gives the program memory and then starts running it. The compiler and assembler create files; they do not run them. Their work ends before the .exe is made. An interpreter is not part of the OS either; it is a separate program.
प्रश्न 2उत्तर + हल
Source code से आप क्या समझते हैं?
What do you mean by source code?
Aसोर्स कोड हाई लेवल लैंग्वेज यानी मानव समझने योग्य भाषा में लिखा जाता है।Source code is written in high level language i.e. human understandable language.
Bसोर्स विस्तार योग्य कोड है यानी Test.c + प्री-प्रोसेसर + टिप्पणियाँSource is expandable code i.e. Test.c + Pre-processors + comments
Cसोर्स कोड असेंबल कोड यानी .s फाइल हैSource code is assemble code i.e. .s file
Dसोर्स कोड ऑब्जेक्टिव कोड है यानी .obj फ़ाइलSource code is objective code i.e. .obj file
सही उत्तर / Answer: (A)
हल / Solution
Source code वह मूल प्रोग्राम है जो programmer C जैसी high level भाषा में लिखता है। इसे इंसान पढ़ और समझ सकता है, और यह Test.c जैसी फ़ाइल में रहता है। Build में यही सबसे पहला input है। Header और directives वाला फैला हुआ कोड expanded code है, source code नहीं। .s फ़ाइल assembly code है और .obj फ़ाइल object code है। ये दोनों बाद में बनते हैं।
Source code is the original program that the programmer writes in a high level language such as C. People can read and understand it, and it is kept in a file like Test.c. It is the very first input of the build. The enlarged code with headers and directives is expanded code, not source code. A .s file is assembly code and a .obj file is object code. Both are made later.
प्रश्न 3उत्तर + हल
Loader का प्रयोग किया जाता है:
Loader is used to:
A.obj कोड लोड करता है और इसे .exe फ़ाइल में परिवर्तित करता हैLoads .obj code and convert it into .exe file
B.s कोड लोड करता है और इसे .exe फ़ाइल में परिवर्तित करता हैLoads .s code and convert it into .exe file
Cसेकेंडरी मेमोरी से .exe फाइल को लोड करता है और प्राइमरी मेमोरी यानी रैम में भेजता है।Loads .exe file from secondary memory and send it into primary memory i.e. RAM.
Dप्राथमिक मेमोरी से .exe फ़ाइल लोड करता है और इसे CPU रजिस्टरों में भेजता है।Loads .exe file from primary memory and send it into CPU registers.
सही उत्तर / Answer: (C)
हल / Solution
प्रोग्राम की .exe फ़ाइल hard disk यानी secondary memory में रहती है। CPU सिर्फ़ RAM से instructions पढ़ सकता है। इसलिए loader .exe को disk से उठाकर primary memory यानी RAM में रखता है, तब प्रोग्राम चलता है। .obj से .exe बनाना linker का काम है, loader का नहीं। .s से सीधे .exe नहीं बनती। पूरी .exe CPU के registers में नहीं जाती, क्योंकि वे बहुत छोटे होते हैं।
A program's .exe file is kept on the hard disk, which is secondary memory. The CPU can read instructions only from RAM. So the loader picks up the .exe from the disk and places it in primary memory, that is RAM, and then the program runs. Making .exe from .obj is the linker's job, not the loader's. An .exe is not made straight from .s. A whole .exe cannot go into CPU registers, because they are very small.
प्रश्न 4उत्तर + हल
.exe फ़ाइल को execute करने के लिए कौन ज़िम्मेदार है?
Who is responsible for executing the .exe file?
ACompiler
BLoader
CInterpreter
DLinker
सही उत्तर / Answer: (B)
हल / Solution
.exe फ़ाइल hard disk पर रखी रहती है। उसे चलाने के लिए loader उसे RAM में लाता है, ज़रूरी memory देता है और CPU को प्रोग्राम की पहली instruction पर भेज देता है। तभी प्रोग्राम चलना शुरू होता है। Loader operating system का हिस्सा है। Compiler और linker का काम .exe बनने तक ख़त्म हो जाता है। Interpreter तैयार .exe नहीं चलाता, वह source code की पंक्तियाँ पढ़कर चलाता है।
The .exe file sits on the hard disk. To run it, the loader brings it into RAM, gives it the memory it needs and sends the CPU to the program's first instruction. Only then does the program start. The loader is part of the operating system. The work of the compiler and linker ends once the .exe is made. An interpreter does not run a ready .exe; it reads and runs source code lines.
प्रश्न 5उत्तर + हल
C भाषा में object code की सारी फ़ाइलों को इकट्ठा करके उन्हें executable फ़ाइल में बदलने के लिए कौन ज़िम्मेदार है?
Who is responsible for collecting all the object code files and converting them into an executable file in C language?
ALoader
BCompiler
CInterpreter
DLinker
सही उत्तर / Answer: (D)
हल / Solution
बड़ा प्रोग्राम कई .c फ़ाइलों में लिखा जाता है, और हर एक से अलग object फ़ाइल बनती है। Linker इन सारी object फ़ाइलों को इकट्ठा करता है। वह printf जैसे library functions का कोड भी जोड़ता है और एक .exe फ़ाइल बनाता है। Loader बाद में इसी .exe को memory में लाता है, उसे बनाता नहीं। Compiler object फ़ाइलें नहीं जोड़ता। Interpreter C के build का हिस्सा ही नहीं है।
A large program is written in many .c files, and each one gives a separate object file. The linker collects all these object files. It also adds the code of library functions such as printf and builds one .exe file. The loader later brings this .exe into memory; it does not create it. The compiler does not join object files. An interpreter is not part of the C build at all.
प्रश्न 6उत्तर + हल
C भाषा में assembly code को object code में बदलने के लिए कौन ज़िम्मेदार है?
Who is responsible for converting assembly code into object code in C language?
AAssembler
BCompiler
CInterpreter
DTranslator
सही उत्तर / Answer: (A)
हल / Solution
Compiler हमारे C कोड से assembly code (.s) बनाता है। इसमें mov, add जैसे निर्देश होते हैं, पर CPU इन्हें सीधे नहीं समझता। Assembler हर assembly निर्देश को उसके binary machine code में बदलता है और object फ़ाइल (.o या .obj) बनाता है। Compiler का काम इससे पहले ख़त्म हो जाता है। Interpreter C के build में आता ही नहीं। Translator सिर्फ़ एक बड़े वर्ग का नाम है, कोई ख़ास tool नहीं।
The compiler turns our C code into assembly code (.s). It has instructions such as mov and add, but the CPU cannot understand them directly. The assembler turns each assembly instruction into binary machine code and makes the object file (.o or .obj). The compiler's work ends before this step. An interpreter is not part of the C build at all. Translator is only the name of a broad group, not a specific tool.
प्रश्न 7उत्तर + हल
C भाषा में source code को assembly code में बदलने के लिए कौन ज़िम्मेदार है?
Who is responsible for converting source code into assembly code in C language?
AAssembler
BCompiler
CInterpreter
DTranslator
सही उत्तर / Answer: (B)
हल / Solution
C के build में compiler preprocessed source code (.i) को पढ़ता है और उससे assembly code (.s) बनाता है। Assembler इसके बाद आता है। वह assembly code को object code में बदलता है, assembly बनाता नहीं। Interpreter C के build में नहीं चलता, वह कोड को एक-एक पंक्ति करके सीधे चलाता है। Translator एक बड़ा वर्ग है, जिसमें compiler, assembler और interpreter तीनों आते हैं। यह ख़ास काम compiler का है।
In the C build, the compiler reads the preprocessed source code (.i) and produces assembly code (.s). The assembler comes after it. It turns assembly code into object code; it does not produce assembly. An interpreter is not used in the C build; it runs code line by line directly. Translator is a broad group that covers the compiler, assembler and interpreter. This specific job belongs to the compiler.
प्रश्न 8उत्तर + हल
C भाषा में expanded code क्या है? (मान लीजिए प्रोग्राम का नाम Test है)
What is expanded code in C language? (Suppose the program name is Test.)
Preprocessor Test.c पर तीन काम करता है। वह #include वाली header फ़ाइलों का कोड जोड़ता है। वह #define जैसे directives चलाकर macros बदलता है। और वह comments हटा देता है। इन तीनों के बाद जो कोड बनता है, वही expanded code (Test.i) है। अकेला source code अभी फैला नहीं है। दूसरा विकल्प अधूरा है, क्योंकि उसमें directives और comments की बात नहीं। Assembly code तो बाद में compiler बनाता है।
The preprocessor does three things to Test.c. It adds the code of the header files named in #include. It runs directives like #define and replaces macros. And it removes comments. The code left after these three steps is the expanded code (Test.i). Plain source code is not expanded yet. The second option is incomplete because it leaves out directives and comments. Assembly code is made later by the compiler.
प्रश्न 9उत्तर + हल
C भाषा में compiler का उपयोग किस फ़ाइल को बदलने के लिए होता है? (मान लीजिए प्रोग्राम का नाम Test है)
The compiler is used to convert which file in C language? (Suppose the program name is Test.)
ATest.c फ़ाइल को Test.i मेंTest.c file into Test.i
BTest.s फ़ाइल को Test.o मेंTest.s file into Test.o
CTest.i फ़ाइल को Test.s मेंTest.i file into Test.s
DTest.o फ़ाइल को Test.exe मेंTest.o file into Test.exe
सही उत्तर / Answer: (C)
हल / Solution
Build में हर tool एक फ़ाइल लेकर अगली फ़ाइल बनाता है। Preprocessor Test.c को Test.i में बदलता है। Compiler इस expanded Test.i को पढ़ता है और assembly वाली Test.s बनाता है। Assembler Test.s को object फ़ाइल Test.o में बदलता है। Linker Test.o को library से जोड़कर Test.exe बनाता है। इसलिए compiler का काम तीसरा विकल्प है। बाक़ी तीन विकल्प दूसरे tools के काम हैं।
In the build, each tool takes one file and makes the next. The preprocessor turns Test.c into Test.i. The compiler reads this expanded Test.i and makes the assembly file Test.s. The assembler turns Test.s into the object file Test.o. The linker joins Test.o with the library and makes Test.exe. So the compiler's job is the third option. The other three options are the jobs of other tools.
प्रश्न 10उत्तर + हल
C भाषा में executable code कौन-सा है? (मान लीजिए प्रोग्राम का नाम Test है)
Which one is the executable code in C language? (Suppose the program name is Test.)
ATest.c
BTest.s
CTest.exe
DTest.t
सही उत्तर / Answer: (C)
हल / Solution
Linker object फ़ाइल और library के कोड को जोड़कर एक पूरी फ़ाइल बनाता है, जिसे operating system सीधे चला सकता है। इसे executable code कहते हैं। Windows पर इसका extension .exe होता है, इसलिए उत्तर Test.exe है। Test.c मूल source फ़ाइल है, जिसे चलाने से पहले compile करना पड़ता है। Test.s assembly code है। Test.t नाम की कोई फ़ाइल C के build में बनती ही नहीं।
The linker joins the object file with library code and builds one complete file that the operating system can run directly. This is called executable code. On Windows its extension is .exe, so the answer is Test.exe. Test.c is the original source file, which must be compiled before it can run. Test.s is assembly code. No file called Test.t is made in a C build.
आगे के 19 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
C प्रोग्राम की output फ़ाइल के बारे में सही कथन चुनिए।
Choose the correct statement about the C program output file.
ALinker हर machine के लिए उसके अनुकूल output फ़ाइल बनाता है।Linker produces a suitable output file for each machine.
B.exe फ़ाइल Linux या UNIX machines पर काम नहीं करती, इसलिए अलग-अलग machines पर अलग तरह का output बनता है।.exe file does not work in Linux or UNIX machines, so different type of output is created on different machines.
COutput फ़ाइल .exe machine पर निर्भर है, .exe Windows के लिए उपयुक्त फ़ाइल है।Output file .exe is machine dependent, .exe is windows suitable file.