Here are reliable UP Board Solutions for Class 12 Computer Science Chapter 9 C++ का परिचय matching the 2026 27 academic session standards. Built around recent UP Board textbook frameworks for Class 12 Computer Science, these expert answers help students learn quickly and are ready for free PDF download.
UP Board Textbook Solutions for Class 12 Computer Science Chapter 9 C++ का परिचय
Use these UP Board textbook questions for Class 12 to establish a solid grasp of Computer Science. Our Class 12 Computer Science solutions deliver detailed, step-by-step guidance for every problem. Working with these Chapter 9 C++ का परिचय solutions makes learning simple and improves exam readiness.
Class 12 Computer Science Chapter 9 C++ का परिचय Textbook Solutions with Answers
बहुविकल्पीय प्रश्न (1 अंक)
Question 1. निम्न में से कौन-सी प्रोग्रामिंग भाषा ऑब्जेक्ट ओरिएण्टेड प्रोग्रामिंग की सुविधा देती है?
(a) C
(b) C++
(c) BASIC
(d) All of the options
Answer: (b) C++
In simple words: C++ is an object-oriented programming language, which means it allows us to organize our code using real-world concepts called objects.
🎯 Exam Tip: Remember that C++ was developed by Bjarne Stroustrup as an extension of the C language to support object-oriented features.
Question 2. निम्न में से कौन-सा शब्द आइडेण्टीफायर नहीं हो सकता?
(a) lotus_123
(b) word
(c) const
(d) sum
Answer: (c) const
In simple words: 'const' is a reserved keyword in C++ with a fixed meaning, so we cannot use it as a custom name (identifier) for variables.
🎯 Exam Tip: Keywords are reserved words and can never be used as identifiers. Keep a list of common keywords like int, float, and const in mind.
Question 3. निम्न में से कौन C++ का मान्य फ्लोटिंग प्वॉइण्ट स्थिरांक है? [2018]
(a) 22.0/7
(b) 120
(c) 1.2.3
(d) None of the options
Answer: (a) 22.0/7
In simple words: A floating-point constant represents fractional numbers. Here, 22.0/7 is a valid expression containing a decimal value.
🎯 Exam Tip: Floating-point constants must contain a decimal point, but they cannot have multiple decimal points like '1.2.3'.
Question 4. int डाटा का साइज होता है। [2018, 17]
(a) 1 बाइट
(b) 2 बाइट
(c) 4 बाइट
(d) None of the options
Answer: (b) 2 बाइट
In simple words: In standard 16-bit compilers (like Turbo C++), an integer (int) data type occupies 2 bytes of memory space.
🎯 Exam Tip: Always specify that 'int' takes 2 bytes in 16-bit systems, as it can take 4 bytes in modern 32-bit or 64-bit systems.
Question 5. किस डाटा टाइप का परास – 32768 से 32767 तक है? [2016]
(a) इण्ट
(b) अनसाइण्ड इण्ट
(c) साइण्ड इण्ट
(d) None of the options
Answer: (a) इण्ट
In simple words: The standard integer (int) data type has a size of 2 bytes, which allows it to store whole numbers ranging from -32,768 to 32,767.
🎯 Exam Tip: Memorize the ranges of basic data types like char (-128 to 127) and int (-32768 to 32767) as they are frequently asked in board exams.
Question 6. किसका उपयोग इनपुट देने में किया जाता है?
(a) cin
(b) gets( )
(c) getchar( )
(d) ये सभी
Answer: (d) ये सभी
C++ में, cin, gets ( ) तथा getchar ( ) का प्रयोग इनपुट युक्तियों से इनपुट देने के लिए किया जाता है।
In simple words: All of these options are used to take input from the user in C++. They help the program read what you type on the keyboard.
🎯 Exam Tip: Remember that different input functions are used for different types of data, but all of them serve the purpose of taking input.
Question 7. फंक्शन gets ( ), puts ( ), getchar ( ) तथा putchar ( ) किस हैडर फाइल में शामिल होते हैं?
(a) stdio.h
(b) iostream.h
(c) conio.h
(d) ये सभी
Answer: (a) stdio.h
In simple words: These functions belong to the standard input-output library, which is represented by the stdio.h header file in C++.
🎯 Exam Tip: Always remember that 'stdio' stands for Standard Input Output, which contains basic functions like gets and puts.
Question 8. निम्न में से कौन-सा एस्केप कैरेक्टर कर्सर के दायीं ओर 8 स्थान होता है? [2018]
(a) \a
(b) \b
(c) \t
(d) इनमें से कोई नहीं
Answer: (c) \t
In simple words: The '\t' character stands for a horizontal tab, which moves the cursor 8 spaces to the right, just like the Tab key on your keyboard.
🎯 Exam Tip: Escape sequences always start with a backslash (\), and '\t' is specifically used for creating tab spaces in output.
Question 9. कर्सर को Next Page पर ले जाने के लिए निम्न Escape sequence characters में से कौन-सा प्रयुक्त होता है? [2017]
(a) \t
(b) \n
(c) \f
(d) इनमें से कोई नहीं
Answer: (c) \f
In simple words: The '\f' character stands for 'form feed', which is used to advance the cursor or printer to the next page.
🎯 Exam Tip: Learn the common escape sequences like \n for new line, \t for tab, and \f for form feed as they are frequently asked in exams.
अति लघु उत्तरीय प्रश्न (1 अंक)
Question 1. टोकन को परिभाषित कीजिए।
Answer: प्रोग्राम में प्रयुक्त होने वाली सबसे छोटी इकाई को टोकन कहते हैं। यह प्रोग्राम का एक मूल निर्माण खंड होता है जिसे कंपाइलर आसानी से पहचान सकता है।
In simple words: A token is the smallest individual unit in a computer program. Just like words are the smallest units of a sentence, tokens are the smallest parts of a code.
🎯 Exam Tip: Define token clearly as the "smallest individual unit" of a program to secure full marks.
Question 2. वेरिएबल को परिभाषित कीजिए। [2011]
Answer: मेमोरी की वह स्थिति जिसमें कोई मान या डाटा संग्रहीत रहता है, वेरिएबल कहलाता है। इसका मान प्रोग्राम के निष्पादन के दौरान बदला जा सकता है।
In simple words: A variable is like a labeled box in the computer's memory where we can store data, and we can change this data whenever we want.
🎯 Exam Tip: Mention that a variable's value can change during program execution to write a complete definition.
Question 3. कैरेक्टर कॉन्स्टेण्ट से क्या तात्पर्य है?
Answer: कैरेक्टर कॉन्स्टेण्ट में कोई वर्ण (अक्षर, अंक या चिह्न) एकल कोटेशन चिह्न (' ') में लिखे जाते हैं; जैसे—'N', '8' तथा '*' आदि। ये मान पूरे प्रोग्राम के दौरान हमेशा स्थिर रहते हैं।
In simple words: A character constant is a single letter, number, or symbol enclosed in single quotes that does not change its value.
🎯 Exam Tip: Always provide examples like 'A' or '5' in single quotes when explaining character constants.
Question 4. जो ऑपरेटर दो ऑपरेण्डों पर क्रिया करते हैं, उन्हें क्या कहा जाता है?
Answer: जो ऑपरेटर दो ऑपरेण्डों पर क्रिया करते हैं, उन्हें बाइनरी ऑपरेटर कहा जाता है। ये ऑपरेटर दो मानों को आपस में जोड़ने या तुलना करने का कार्य करते हैं।
In simple words: Operators that need two values (operands) to work, like the plus sign (+) in '5 + 3', are called binary operators.
🎯 Exam Tip: Give a quick example like '+' or '-' to make your answer clear and impactful.
Question 5. रिलेशनल ऑपरेटर्स को परिभाषित कीजिए। [2011]
Answer: जिन ऑपरेटर्स का प्रयोग दो विभिन्न संख्याओं या एक्सप्रेशन की तुलना करने के लिए किया जाता है, रिलेशनल ऑपरेटर्स कहलाते हैं। ये तुलना करके सत्य (true) या असत्य (false) में परिणाम देते हैं।
In simple words: Relational operators are symbols used to compare two values, like checking if one number is greater than or equal to another.
🎯 Exam Tip: Mention symbols like <, >, and == as examples of relational operators to score full marks.
Question 6. C++ में, लॉजिकल ऑपरेटर्स कौन-कौन से हैं?
Answer: C++ में लॉजिकल ऑपरेटर्स निम्न हैं:
1. लॉजिकल एण्ड (AND)
2. लॉजिकल और (OR)
3. लॉजिकल नॉट (NOT)
ये ऑपरेटर्स विभिन्न कंडीशंस को आपस में जोड़ने और उनका मूल्यांकन करने में मदद करते हैं।
In simple words: Logical operators are used to combine multiple conditions to make decisions, like checking if both Condition A AND Condition B are true.
🎯 Exam Tip: List all three logical operators (AND, OR, NOT) clearly with their symbols if possible, or just their names as written.
Question 7. जो ऑपरेटर वेरिएबल के बाद उपयोग किए जाते हैं, उन्हें क्या कहा जाता है?
Answer: जो ऑपरेटर वेरिएबल के बाद उपयोग किए जाते हैं, उन्हें पोस्टफिक्स ऑपरेटर कहा जाता है। ये वेरिएबल के मान को उपयोग करने के बाद बदलते हैं।
In simple words: Postfix operators are placed after the variable name, like writing 'x++', which uses the value first and then increases it by one.
🎯 Exam Tip: Use the example of 'x++' to clearly demonstrate a postfix operator in action.
Question 8. पॉइंटर एक्सप्रेशन से क्या तात्पर्य है?
Answer: ऐसी एक्सप्रेशन जो एड्रेस का मान स्टोर और उसे प्रस्तुत करती है, पॉइंटर एक्सप्रेशन कहलाती है। यह सीधे मेमोरी लोकेशन के साथ काम करने की सुविधा देती है।
In simple words: A pointer expression is a formula or statement that deals with memory addresses instead of direct values.
🎯 Exam Tip: Highlight the word "address" (एड्रेस) as it is the key term examiners look for in this definition.
Question 9. वेरिएबल sum का मान कॉन्सोल (स्क्रीन) पर दिखाने के लिए क्या कथन होगा?
Answer: वेरिएबल sum का मान कॉन्सोल (स्क्रीन) पर दिखाने के लिए निम्न कथन होगा:
cout<<sum;
यह कथन स्क्रीन पर sum वेरिएबल में सुरक्षित मान को प्रदर्शित करता है।
In simple words: To print the value of a variable named 'sum' on the screen in C++, we use the 'cout' statement followed by the insertion operator.
🎯 Exam Tip: Do not forget the semicolon (;) at the end of the statement, as C++ statements must end with a semicolon.
Question 10. प्रोग्राम के पहले आउटपुटों को क्लीयर करने के लिए किस कमाण्ड का प्रयोग किया जाता है?
Answer: clrscr ( ) फंक्शन का प्रयोग पहले आउटपुटों को क्लीयर करने के लिए किया जाता है। यह स्क्रीन को साफ करके नया आउटपुट दिखाने में मदद करता है।
In simple words: The 'clrscr()' function is used to clear the previous output from the console screen so you only see the current run's results.
🎯 Exam Tip: Mention that 'clrscr()' stands for 'clear screen' and is usually found in the conio.h header file.
लघु उत्तरीय प्रश्न I (2 अंक)
Question 1. C++ की प्रमुख विशेषताओं का उल्लेख कीजिए। [2015, 14, 08]
Answer: C++ की प्रमुख विशेषताएँ निम्न हैं:
1. इसमें किसी भी समस्या की जटिलता को कम करने की क्षमता होती हैं। यह ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग सिद्धांतों का उपयोग करके बड़े प्रोग्रामों को सरल बनाती है।
In simple words: C++ is a powerful programming language that helps simplify complex programming problems by breaking them down into smaller, manageable parts.
🎯 Exam Tip: Mention that C++ is an Object-Oriented Programming (OOP) language as its primary feature to score full marks.
Question 2. उदाहरण सहित टोकन का अर्थ समझाइए। [2015, 07]
Answer: प्रोग्राम में प्रयुक्त होने वाली सबसे छोटी इकाई को टोकन कहते हैं। टोकन प्रोग्राम की अविभाज्य इकाई है। अनेक टोकन की क्रमबद्ध श्रृंखला से स्टेटमेंट बनते हैं। C++ में प्रयुक्त टोकन निम्न प्रकार हैं:
1. की-वर्ड
2. आइडेन्टीफायर
3. कॉन्स्टेण्ट
4. ऑपरेटर्स
5. स्ट्रिंग
In simple words: A token is the smallest individual unit in a C++ program, just like words are the smallest units in a written sentence. Examples include keywords, identifiers, and operators.
🎯 Exam Tip: Always list all five types of tokens and give a brief example of each (like 'int' for keyword or '+' for operator) to score full marks.
Question 3. आइडेन्टीफायर तथा की-वर्ड में अन्तर बताइए।
Answer: आइडेन्टीफायर तथा की-वर्ड में अन्तर इस प्रकार हैं:
| आइडेन्टीफायर | की-वर्ड |
|---|---|
| आइडेन्टीफायर विभिन्न प्रकार के प्रोग्राम के नाम होते हैं; जैसे-वैरिएबल, फंक्शन, ऐरे। | की-वर्ड पहले से रिजर्व्ड या प्रिडिफाइण्ड नाम होते हैं। |
| यह लैटर तथा डिजिट को संरक्षित करता है। | यह केवल लैटर को संरक्षित करता है। |
| इसमें अपरकेस तथा लोअरकेस लैटर का प्रयोग होता है। | इसमें केवल लोअरकेस लैटर का प्रयोग होता है। |
| उदाहरण: num_5, arg | उदाहरण: auto, short |
In simple words: Keywords are reserved words with fixed meanings in C++ (like 'auto'), while identifiers are names created by the programmer for variables or functions (like 'num_5').
🎯 Exam Tip: Presenting differences in a neat tabular format with examples of both keywords and identifiers helps you secure maximum marks.
Question 4. हैडर फाइल पर संक्षिप्त टिप्पणी कीजिए। [2012]
Answer: वे फाइलें जिनमें लाइब्रेरी फंक्शन्स संकलित होते हैं, हैडर फाइल कहलाती हैं। C++ में, अनेक हैडर फाइल्स होती हैं, जो अलग-अलग फंक्शन्स को सम्मिलित करती हैं। जैसे <iostream.h> हैडर फाइल cin और cout के लिए तथा <stdio.h> हैडर फाइल gets( ), puts( ), getchar( ) और putchar( ) फंक्शन्स के लिए होती हैं।
In simple words: Header files are like toolboxes containing ready-made functions (like cin or cout) that we can easily use in our program without writing them from scratch.
🎯 Exam Tip: Always mention the specific header files like <iostream.h> and their associated functions (cin, cout) to make your answer complete.
Question 5. निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?
#include<iostream.h>
void main( ) {
int age;
cout<<“Mera “;
cout<<” Bharat “;
cout<<” Mahan. “;
cout<<“Vande Mataram !”;
}
Answer: Mera Bharat Mahan. Vande Mataram !
In simple words: The program uses 'cout' to print text on the screen. Since there are no newline commands (like endl or \n), all the words are printed continuously on the same line.
🎯 Exam Tip: Pay close attention to spaces inside the quotes and the absence of '\n' or 'endl' when writing the final output string.
Question 6. डाटा प्रकार के उदाहरण देकर व्याख्या संक्षेप में कीजिए। [2018]
Answer: कम्प्यूटर में दिए जाने वाले इनपुट को डाटा कहते हैं। प्रत्येक प्रोग्राम किसी डाटा पर किसी विशेष क्रम में क्रियाएँ करता है और ये डाटा एक टाइप पर निर्भर करते हैं, जिन्हें डाटा टाइप कहते हैं।
उदाहरण:
1. इण्टीजर डाटा टाइप जैसे – 453, 75 आदि
2. करैक्टर डाटा टाइप जैसे – ‘M’, ‘+’ आदि
3. फ्लोट डाटा टाइप जैसे – 154.02, 145.44 आदि
In simple words: Data types tell the computer what kind of value a variable can hold, such as whole numbers (integers), letters (characters), or decimal numbers (floats).
🎯 Exam Tip: Clearly categorize the examples into Integer, Character, and Float types to show a structured understanding of data types.
Question 7. C व C ++ के बीच कोई दो अन्तर बताइए। [2017]
Answer: C व C ++ के बीच दो मुख्य अन्तर निम्नलिखित हैं:
1. C एक प्रोसीजरल (Procedural) प्रोग्रामिंग भाषा है, जबकि C++ एक ऑब्जेक्ट-ओरिएंटेड (Object-Oriented) प्रोग्रामिंग भाषा है।
2. C में फंक्शन ओवरलोडिंग (Function Overloading) का समर्थन नहीं होता है, जबकि C++ में यह सुविधा उपलब्ध होती है।
In simple words: C is a simpler language focused on steps, while C++ is a modern version that supports objects and real-world modeling.
🎯 Exam Tip: Highlighting 'Object-Oriented Programming (OOPs)' as the key difference is crucial for scoring full marks in this comparison.
| C | C++ |
|---|---|
| C एक प्रोसीजर ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। | C++ एक प्रोसीजर प्रोग्रामिंग तथा ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग दोनों लैंग्वेज का मिश्रण है। |
| C में इनहेरिटेंस की सुविधा उपलब्ध नहीं है। | C++ में इनहेरिटेंस की सुविधा उपलब्ध है। |
लघु उत्तरीय प्रश्न II (3 अंक)
Question 1. C++ के सन्दर्भ में अर्थमैटिक तथा लॉजिकल ऑपरेटर्स को समझाइए। [2011, 09]
Answer: अर्थमैटिक ऑपरेटर्स: ये ऑपरेटर्स सामान्य अर्थमैटिक क्रियाओं में प्रयोग किए जाते हैं। इस प्रकार के ऑपरेटर को बाइनरी ऑपरेटर भी कहा जाता है। अर्थमैटिक ऑपरेटर्स निम्न प्रकार हैं:
| ऑपरेटर्स | अर्थ |
|---|---|
| + | योग |
| - | घटाव |
| * | गुणा |
| % | भाग शेष (मॉड्यूलस) |
| / | भाग |
| ऑपरेटर्स | अर्थ |
|---|---|
| && | लॉजिकल एण्ड (AND) |
| || | लॉजिकल और (OR) |
| ! | लॉजिकल नॉट (NOT) |
In simple words: Arithmetic operators are used for basic math like adding or multiplying numbers. Logical operators are used to combine two or more conditions to make decisions, resulting in either true or false.
🎯 Exam Tip: Always write the symbols clearly and provide a small table showing the operator and its meaning to secure full marks.
Question 2. रिलेशनल ऑपरेटर का प्रयोग करके एक प्रोग्राम लिखिए। [2016]
Answer: रिलेशनल ऑपरेटर का उपयोग करके दो मानों की तुलना करने वाला C++ प्रोग्राम नीचे दिया गया है:
#include<iostream.h>
void main( ) {
int a = 20, b= 10;
if (a==b) {
cout<<"a is equal to b";
} else {
cout<<"a is not equal to b";
}
}
यह प्रोग्राम '==' रिलेशनल ऑपरेटर का उपयोग करके जांचता है कि क्या a और b बराबर हैं।
In simple words: This program compares two numbers, 20 and 10. Since they are not equal, it will print "a is not equal to b" on the screen.
🎯 Exam Tip: Remember to include the correct header files and use proper syntax for the relational operator '==' instead of a single '=' which is an assignment operator.
Question 3. C++ में ऑपरेटर्स तथा एक्सप्रेशन्स को समझाइए। [2016]
Answer: ऑपरेटर्स किसी विशेष प्रकार के डाटा पर की जाने वाली क्रिया को व्यक्त करने के लिए जिस चिह्न का प्रयोग किया जाता है, उसे ऑपरेटर कहते हैं। ये कंपाइलर को विशिष्ट गणितीय या तार्किक जोड़-तोड़ करने का निर्देश देते हैं। ऑपरेटर्स निम्न प्रकार के होते हैं:
1. अंकगणितीय ऑपरेटर
2. लॉजिकल ऑपरेटर
3. रिलेशनल ऑपरेटर
4. असाइनमेंट ऑपरेटर
5. कण्डीशनल ऑपरेटर
6. इन्क्रीमेंट तथा डिक्रीमेंट ऑपरेटर्स
In simple words: Operators are special symbols in C++ used to perform calculations or compare values, like '+' for adding or '>' for comparing.
🎯 Exam Tip: List all six types of operators clearly. Writing a brief one-line description or example for each type can help you score maximum marks.
एक्सप्रेशन (Expression)
एक्सप्रेशन एक या एक से अधिक वैरिऐबलों, कॉन्स्टेण्टों तथा ऑपरेटरों का एक ऐसा वैध (Valid) समूह है, जिसका C++ भाषा में एक निश्चित मान निकाला जा सकता है। सभी एक्सप्रेशन को ऑपरेटर की प्राथमिकता के आधार पर हल किया जाता है। एक से ज्यादा ऑपरेटर्स की समान प्राथमिकता होने पर एक्सप्रेशन को बाएँ से दाएँ हल किया जाता है। एक्सप्रेशन निम्न प्रकार की होती है:
- 1. अंकगणितीय एक्सप्रेशन
- 2. सम्बन्धवाचक एक्सप्रेशन
- 3. लॉजिकल एक्सप्रेशन
- 4. पॉइंटर एक्सप्रेशन
Question 4. निम्न को परिभाषित कीजिए।
(i) cin
(ii) cout
(iii) getch()
Answer:
(i) cin: यह एक फंक्शन न होकर ऑपरेटर है, जिसका कार्य इनपुट युक्तियों द्वारा इनपुट देना है। cin को >> चिह्न के साथ प्रयोग किया जाता है। इसकी हैडर फाइल <iostream.h> है। कंप्यूटर प्रोग्राम में यूजर से वैल्यू लेने के लिए इसका इस्तेमाल किया जाता है।
(ii) cout: यह भी एक ऑपरेटर है, जिसका कार्य आउटपुट युक्ति द्वारा आउटपुट प्रदर्शित करना है। यह << चिह्न के साथ प्रयोग किया जाता है। इसकी हैडर फाइल <iostream.h> है।
(iii) getch(): यह एक फंक्शन है, जिसका प्रयोग प्रोग्राम रन करने के बाद आउटपुट को स्क्रीन पर रोकने के लिए किया जाता है। इसकी हैडर फाइल <conio.h> है।
In simple words: cin is used to take input from the user, cout is used to display output on the screen, and getch() keeps the output screen open until you press a key.
🎯 Exam Tip: Always remember to mention the correct header files like <iostream.h> for cin/cout and <conio.h> for getch() to score full marks.
दीर्घ उत्तरीय प्रश्न (5 अंक)
Question 1. उदाहरण सहित C++ के विभिन्न प्रकार के ऑपरेटर्स को समझाइए।
Answer: किसी विशेष प्रकार के डाटा पर की जाने वाली क्रिया को व्यक्त करने के लिए जिस चिह्न का प्रयोग किया जाता है, उसे ऑपरेटर कहते हैं। C++ में प्रयुक्त ऑपरेटर्स के मुख्य प्रकार निम्नलिखित हैं, जो प्रोग्रामिंग को आसान और प्रभावी बनाते हैं:
(i) अंकगणितीय ऑपरेटर्स (Arithmetic Operators): ये ऑपरेटर्स सामान्य गणितीय क्रियाओं में प्रयोग किए जाते हैं, इन्हें बाइनरी ऑपरेटर भी कहा जाता है। अंकगणितीय ऑपरेटर्स निम्न हैं:
| ऑपरेटर | कार्य |
|---|---|
| + | योग (Addition) |
| - | घटाव (Subtraction) |
| * | गुणा (Multiplication) |
| / | भाग (Division) |
| % | भाग शेष / मॉड्यूलस (Remainder) |
(ii) रिलेशनल ऑपरेटर्स (Relational Operators): इन ऑपरेटर्स का प्रयोग दो विभिन्न संख्याओं या एक्सप्रेशन की तुलना करने के लिए किया जाता है। रिलेशनल ऑपरेटर्स निम्न हैं:
| ऑपरेटर | विवरण |
|---|---|
| < | कम (Less than) |
| > | अधिक (Greater than) |
| <= | कम या बराबर (Less than or equal to) |
| >= | अधिक या बराबर (Greater than or equal to) |
| == | बराबर (Equal to) |
| != | बराबर नहीं (Not equal to) |
(iii) लॉजिकल ऑपरेटर्स (Logical Operators): इन ऑपरेटर्स का प्रयोग दो लॉजिकल या सम्बन्धवाचक एक्सप्रेशन को जोड़ने में किया जाता है। ये ऑपरेटर्स बूलियन बीजगणित के अन्तर्गत आते हैं।
In simple words: Operators are special symbols in C++ used to perform calculations (like +, -) or comparisons (like >, <) between values.
🎯 Exam Tip: When explaining operators, always draw a neat table showing the symbol and its meaning to secure full marks.
(iv) असाइनमेंट ऑपरेटर्स (Assignment Operators)
इन ऑपरेटर्स का प्रयोग किसी वेरिएबल की वैल्यू निश्चित करने या बदलने के लिए किया जाता है।
मुख्य असाइनमेंट ऑपरेटर्स निम्न हैं:
- = : असाइनमेंट (Assignment)
- += : जोड़ असाइनमेंट (Add Assignment)
- -= : घटाव असाइनमेंट (Subtract Assignment)
- /= : भाग असाइनमेंट (Divide Assignment)
Question 2. निम्न पर टिप्पणी लिखिए:
(i) ऑपरेटर प्राथमिकता
(ii) इनपुट-आउटपुट फंक्शन
Answer:
(i) ऑपरेटर प्राथमिकता (Operator Precedence): एक्सप्रेशन को हल करने के लिए ऑपरेटर की प्राथमिकता का ज्ञान होना आवश्यक है, क्योंकि सभी एक्सप्रेशन को ऑपरेटर्स की प्राथमिकता के आधार पर हल किया जाता है। एक एक्सप्रेशन में दो या दो से अधिक ऑपरेटर्स की समान प्राथमिकता होने पर एक्सप्रेशन को बाएँ से दाएँ क्रम में हल किया जाता है।
ऑपरेटर्स की प्राथमिकता का क्रम (उच्चतम से निम्नतम) इस प्रकार है:
• ++, --, ! (उच्चतम प्राथमिकता)
• *, /, %
• +, -
• <<, >>
• <, <=, >, >=
• ==, !=
• &&
• || (निम्नतम प्राथमिकता)
(ii) इनपुट-आउटपुट फंक्शन (Input-Output Functions): सभी कम्प्यूटर प्रोग्राम में, इनपुट युक्तियों द्वारा इनपुट दिया जाता है, जो प्रोसेस होकर आउटपुट युक्तियों द्वारा आउटपुट प्रदर्शित करता है। C++ भाषा में, इनपुट-आउटपुट क्रियाओं के लिए जो फंक्शन प्रयोग किए गए हैं, उन्हें इनपुट-आउटपुट फंक्शन कहा जाता है, जिनकी अलग हैडर फाइल होती है। C++ में प्रयुक्त होने वाले कुछ मुख्य इनपुट-आउटपुट फंक्शन निम्न प्रकार हैं:
• gets( )
• puts( )
• putchar( )
• getchar( )
In simple words: ऑपरेटर प्राथमिकता यह तय करती है कि गणितीय समीकरण में कौन सा काम पहले होगा, जैसे गुणा पहले और जोड़ बाद में। इनपुट-आउटपुट फंक्शन कंप्यूटर को यूजर से जानकारी लेने और स्क्रीन पर परिणाम दिखाने में मदद करते हैं।
🎯 Exam Tip: परीक्षा में ऑपरेटर प्राथमिकता का क्रम लिखते समय उच्चतम (Highest) और निम्नतम (Lowest) प्राथमिकता को स्पष्ट रूप से दर्शाएं ताकि पूरे अंक मिल सकें।
Question 3. C++ के प्रोग्राम के ढाँचे को समझाइए। [2013, 11, 09]
Answer: C++ भाषा में, प्रोग्राम की संरचना का ज्ञान होना अति आवश्यक है, क्योंकि इसके बिना हम कोई भी प्रोग्राम नहीं बना सकते हैं। C++ का एक साधारण प्रोग्राम नीचे दिया गया है:
#include<iostream.h>
#include<conio.h>
void main( )
{
clrscr( );
cout<<"This is Arihant";
getch( );
}
उपरोक्त प्रोग्राम की व्याख्या इस प्रकार है:
1. प्रोग्राम की पहली पंक्ति #include<iostream.h> से शुरू होती है, जो एक प्रीप्रोसेसर डायरेक्टिव है जिसमें cout की परिभाषा शामिल है। यह इनपुट-आउटपुट स्ट्रीम को नियंत्रित करता है।
2. दूसरी पंक्ति में #include<conio.h> है, जो clrscr() तथा getch() फंक्शन्स की हैडर फाइल है और इनके बारे में कंपाइलर को सूचना देती है।
3. यदि प्रोग्राम में क्लास डिफाइन नहीं है तो इसके बाद main() फंक्शन आता है, जिसमें प्रोग्राम का मुख्य कथन लिखा जाता है। प्रोग्राम का निष्पादन यहीं से शुरू होता है।
4. मँझले कोष्ठक { } (curly braces) का प्रयोग main() फंक्शन की शुरुआत व अंत को प्रदर्शित करने के लिए किया जाता है।
5. clrscr() का उपयोग स्क्रीन को साफ करने के लिए किया जाता है।
In simple words: C++ प्रोग्राम का एक निश्चित ढांचा होता है जिसमें सबसे ऊपर हैडर फाइलें होती हैं, फिर main() फंक्शन होता है जिसके अंदर हमारा मुख्य कोड मँझले कोष्ठक { } के बीच लिखा जाता है।
🎯 Exam Tip: C++ प्रोग्राम का ढांचा समझाते समय एक छोटा और सही उदाहरण प्रोग्राम जरूर लिखें और मुख्य भागों जैसे header files, main() और curly braces को रेखांकित करें।
Question. C++ प्रोग्राम के निम्नलिखित कथनों और फंक्शनों के कार्य स्पष्ट कीजिए।
Answer: फंक्शन का प्रयोग आउटपुट स्क्रीन से पहले आउटपुट को हटाने के लिए किया जाता है।
cout << "This is Arihant"; यह प्रोग्राम का मुख्य कथन है, जो स्क्रीन पर This is Arihant प्रदर्शित करेगा।
getch() फंक्शन का प्रयोग आउटपुट को स्क्रीन पर रोकने के लिए किया जाता है।
In simple words: In C++, cout displays text on the screen, getch() keeps the output window open so you can read it, and the clear screen function cleans up previous outputs.
🎯 Exam Tip: Clearly mention the header files required for these functions, such as iostream for cout and conio.h for getch(), to show complete understanding.
Free study material for Computer Science
Step-by-Step Textbook Answers: Class 12 Computer Science Chapter 9 C++ का परिचय
UP Board Solutions Class 12 Computer Science Chapter 9 C++ का परिचय
Utilize our professionally drafted UP Board Solutions for Chapter 9 C++ का परिचय to support your daily learning. Covering all textbook exercises for Class 12 Computer Science, these materials are routinely refreshed to stay completely aligned with the newest UP Board syllabus and curriculum directives.
Detailed Explanations for Chapter 9 C++ का परिचय
Benefit from expertly drafted, step-by-step explanations tackling the hardest items in the Class 12 Computer Science curriculum. These breakdowns ensure Class 12 students grasp the core principles governing both theory and calculations, making our UP Board Questions and Answers an invaluable asset for foundational growth.
Benefits of using Computer Science Class 12 Solved Papers
Integrating our Computer Science solution guides into your routine enhances cognitive pacing and accuracy. These resources act as an effective roadmap for Class 12 homework tasks, which can be augmented further using our curated Revision Notes and Sample Papers for Chapter 9 C++ का परिचय to ensure comprehensive exam coverage.
FAQs
The complete and updated UP Board Solutions Class 12 Computer Science Chapter 9 C++ का परिचय is available for free on StudiesToday.com. These solutions for Class 12 Computer Science are as per latest UP Board curriculum.
Yes, our experts have revised the UP Board Solutions Class 12 Computer Science Chapter 9 C++ का परिचय as per 2026 exam pattern. All textbook exercises have been solved and have added explanation about how the Computer Science concepts are applied in case-study and assertion-reasoning questions.
Toppers recommend using UP Board language because UP Board marking schemes are strictly based on textbook definitions. Our UP Board Solutions Class 12 Computer Science Chapter 9 C++ का परिचय will help students to get full marks in the theory paper.
Yes, we provide bilingual support for Class 12 Computer Science. You can access UP Board Solutions Class 12 Computer Science Chapter 9 C++ का परिचय in both English and Hindi medium.
Yes, you can download the entire UP Board Solutions Class 12 Computer Science Chapter 9 C++ का परिचय in printable PDF format for offline study on any device.