UP Board Solutions Class 12 Computer Chapter 12 Functions And Functions Overloading

Get the most accurate UP Board Solutions for Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग here. Updated for the 2026 27 academic session, these solutions are based on the latest UP Board textbooks for Class 12 Computer Science. Our expert-created answers for Class 12 Computer Science are available for free download in PDF format.

Detailed Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग UP Board Solutions for Class 12 Computer Science

For Class 12 students, solving UP Board textbook questions is the most effective way to build a strong conceptual foundation. Our Class 12 Computer Science solutions follow a detailed, step-by-step approach to ensure you understand the logic behind every answer. Practicing these Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग solutions will improve your exam performance.

Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग UP Board Solutions PDF

बहुविकल्पीय प्रश्न (1 अंक)

 

Question 1. C++ भाषा में कितने प्रकार के फंक्शन्स होते हैं?
(a) एक
(b) दो
(c) तीन
(d) असंख्य
Answer: (b) दो (C++ भाषा में दो प्रकार के फंक्शन्स होते हैं - लाइब्रेरी फंक्शन व यूजर डिफाइण्ड फंक्शन)
In simple words: C++ programming language has two main types of functions: built-in library functions that come ready-to-use, and user-defined functions that programmers write themselves.

🎯 Exam Tip: Remember the two categories: Library functions (built-in) and User-defined functions (created by the user).

 

Question 2. ऐसे फंक्शन जो C++ भाषा में पहले से ही सम्मिलित हैं, क्या कहलाते हैं?
(a) बिल्ट-इन फंक्शन
(b) लाइब्रेरी फंक्शन
(c) 'a' और 'b' दोनों
(d) इनमें से कोई नहीं
Answer: (c) 'a' और 'b' दोनों (बिल्ट-इन या लाइब्रेरी फंक्शन C++ भाषा में पहले से ही सम्मिलित होते हैं।)
In simple words: Functions that are already built into the C++ language libraries are called both built-in functions and library functions.

🎯 Exam Tip: "Built-in" and "Library" functions are synonymous terms in C++ referring to pre-existing code packages.

 

Question 3. log( ) फंक्शन किस हैडर फाइल में उपस्थित होता है?
(a) math.h
(b) ctype.h
(c) iostream.h
(d) string.h
Answer: (a) math.h
In simple words: Mathematical operations like log() are grouped inside the math.h header file, which provides various math-related functionalities.

🎯 Exam Tip: Standard mathematical operations like log(), sin(), and cos() always require including the math.h header file.

 

Question 4. islower( ) फंक्शन किस हैडर फाइल में होता है?
(a) string.h
(b) ctype.h
(c) math.h
(d) conio.h
Answer: (b) ctype.h
In simple words: The islower() function checks if a character is in lowercase, and it belongs to the ctype.h header file, which deals with character types.

🎯 Exam Tip: Character handling functions starting with 'is' (like islower, isupper, isalpha) are stored in the ctype.h header file.

 

Question 5. वह कौन-सा फंक्शन है, जो स्वयं को ही बार-बार कॉल करता है?
(a) रिकर्सिव फंक्शन
(b) strlen( )
(c) main( )
(d) clrscr( )
Answer: (a) रिकर्सिव फंक्शन
In simple words: A function that keeps calling itself to solve a smaller part of the same problem is called a recursive function.

🎯 Exam Tip: Recursion is a programming technique where a function calls itself directly or indirectly to solve repetitive tasks.

 

Question 6. हैडर फाइल के विस्तारक का क्या नाम है?
(a) .e
(b) .f
(c) .h
(d) इनमें से कोई नहीं
Answer: (c) .h
In simple words: C++ header files use the ".h" file extension to show they contain declarations and function definitions.

🎯 Exam Tip: Every standard or custom header file in C++ is saved with a .h extension, such as iostream.h or math.h.

 

Question 7. हैडर फाइल 'Conio.h' निम्न किस फंक्शन को declare करता है, जो DOs कन्सोल I/O routines को Call करने में प्रयुक्त होता है? [2017]
(a) fwrite
(b) delline
(c) abs
(d) Ifind
Answer: (a) fwrite
In simple words: The header file conio.h is used for console input-output routines in DOS environments.

🎯 Exam Tip: Functions like clrscr() and getch() are also declared inside the conio.h header file.

 

Question 8. निम्न में से कौन-सा फंक्शन हैडर फाइल stdlib.h में पाया जाता है? [2018]
(a) feof
(b) abs
(c) strch
(d) cgets
Answer: (d) cgets
In simple words: The stdlib.h header file contains general utility functions for memory allocation, process control, conversions, and other system actions.

🎯 Exam Tip: Note the functions included in standard utility libraries like stdlib.h for board exams.

 

अतिलघु उत्तरीय प्रश्न (1 अंक)

 

Question 1. फंक्शन शब्द को समझाइए। [2012]
Answer: प्रोग्राम को छोटे-छोटे भागों में विभाजित करना, जो किसी विशेष ऑपरेशन या कार्य उद्देश्य को पूरा कर सके, फंक्शन कहलाता है। यह बड़े कोड को प्रबंधित करने में अत्यधिक सहायक होता है।
In simple words: A function is a self-contained block of code designed to perform a specific task, making the main program smaller and easier to manage.

🎯 Exam Tip: Define a function as a modular, reusable block of code that performs a specific sub-task in a program.

 

Question 2. फंक्शन के क्या उपयोग है? [2012]
Answer: फंक्शन का उपयोग गणितीय गणनाएँ करने के लिए किया जाता है। इसके अतिरिक्त, यह जटिल गणनाओं को छोटे-छोटे हिस्सों में बांटकर कोड को सरल बनाता है।
In simple words: Functions are used to perform calculations, reuse code blocks, and make programs clean and easy to understand.

🎯 Exam Tip: Mention code reusability and simplifying complex calculations as the primary purposes of functions.

 

Question 3. tan(x) फंक्शन का प्रयोग लिखिए।
Answer: tan(x) फंक्शन किसी कोण x की टेन्जेन्ट (tangent) ज्ञात करने के लिए प्रयोग होता है। यह त्रिकोणमितीय मानों की गणना को स्वचालित करने का कार्य करता है।
In simple words: The tan(x) function finds the tangent value of a given angle 'x' in trigonometry calculations.

🎯 Exam Tip: Remember that trigonometric functions like tan(x) accept angle arguments in radians rather than degrees.

 

Question 4. फंक्शन को डिक्लेयर करने का प्रारूप लिखिए।
Answer: फंक्शन को डिक्लेयर करने का सामान्य प्रारूप निम्नलिखित है: return_type function_name(parameter_list);। यह कंपाइलर को फंक्शन के नाम, उसके रिटर्न प्रकार तथा उसके मापदंडों की पूर्व जानकारी प्रदान करता है।
In simple words: To declare a function, you write the return type, the function name, and its parameters inside parentheses, followed by a semicolon.

🎯 Exam Tip: Always end a function declaration with a semicolon, which separates it from a function definition.

 

Question 5. किसी फंक्शन को कॉल कैसे किया जाता है?
Answer: किसी फंक्शन को किसी प्रोग्राम में उसका नाम देकर, उसके साथ वास्तविक पैरामीटर को लगाकर एक कोष्ठक के अन्दर रखकर तथा सेमीकॉलन लगाकर कॉल किया जाता है। ऐसा करने से प्रोग्राम का नियंत्रण सीधे उस फंक्शन के पास चला जाता है।
In simple words: You call a function by writing its name followed by actual values (arguments) in parentheses and a semicolon.

🎯 Exam Tip: State clearly that calling a function triggers its execution and requires matching arguments as defined in its prototype.

 

Question 6. लोकल वैरिएबल किसे कहते हैं?
Answer: जहाँ वैरिएबल एक फंक्शन या ब्लॉक में प्रयोग किए जाते हैं, लोकल वैरिएबल कहलाते हैं। इनका कार्यक्षेत्र (scope) केवल उसी विशिष्ट फंक्शन या ब्लॉक के भीतर ही सीमित रहता है।
In simple words: Variables created inside a specific function or block of code are local variables, and they cannot be accessed outside that function.

🎯 Exam Tip: Emphasize that local variables are destroyed as soon as the execution of the block in which they are declared is completed.

 

लघु उत्तरीय प्रश्न I (2 अंक)

 

Question 1. फंक्शन के लाभ लिखिए।
Answer: फंक्शन के निम्नलिखित लाभ हैं:

  • फंक्शन किसी भी प्रोग्राम को छोटा बना देता है, जिससे प्रोग्राम समझने में आसानी होती है।
  • फंक्शन की सहायता से एक कोड को पुनः नहीं लिखना पड़ता है, यूजर अपनी आवश्यकतानुसार फंक्शन प्रोग्राम में कहीं भी प्रयोग कर सकता है।
  • फंक्शन के प्रयोग से प्रोग्राम में त्रुटि खोजना बहुत आसान हो जाता है।
ये लाभ प्रोग्राम के रख-रखाव को भी बेहद सरल और सुव्यवस्थित बना देते हैं।
In simple words: Functions help make code shorter and easier to understand, prevent repeating the same code, and make finding and fixing errors much simpler.

🎯 Exam Tip: Write down these three key benefits of functions—readability, reusability, and easy debugging—to score full marks.

 

Question 2. उदाहरण देकर फॉर्मल (Formal) व एक्चुअल (Actual) पैरामीटर्स को समझाइए। [2012]
Answer: फॉर्मल पैरामीटर जो पैरामीटर फंक्शन को परिभाषित करने में प्रयोग होते हैं, फॉर्मल पैरामीटर कहलाते हैं। एक्चुअल पैरामीटर जो पैरामीटर फंक्शन कॉल करने में प्रयोग किए जाते हैं, एक्चुअल पैरामीटर कहलाते हैं।
उदाहरण के लिए निम्नलिखित कोड खंड को देखें:
int square (int);
int main( )
{
    int v, s = 5;
    square(s);
}
int square (int a)
{
    return a*a;
}

यहाँ, 's' एक्चुअल पैरामीटर (Actual Parameter) है और 'a' फॉर्मल पैरामीटर (Formal Parameter) है। इन दोनों का उपयोग डेटा स्थानांतरण के लिए होता है।
In simple words: Actual parameters are the real values passed when calling a function, while formal parameters are variables defined in the function's header to receive those values.

🎯 Exam Tip: Use a simple code snippet to illustrate actual parameters (in function call) and formal parameters (in function definition).

 

Question 3. C++ फंक्शन के केवल उस प्रोग्राम खण्ड को लिखें, जो 100 से 1 तक की गिनती 'for' लूप का प्रयोग करके प्रिंट करें। [2012]
Answer: 100 से 1 तक की उलटी गिनती प्रदर्शित करने के लिए निम्न कोड खंड का उपयोग किया जाता है:
void Reverse ( )
{
    std::cout << "The Reverse number" << std::endl;
    for (int i = 100; i >= 1; i--)
    {
        std::cout << i << " ";
    }
}

यह प्रोग्राम लूप की सहायता से संख्याओं को घटते हुए क्रम में सुचारू रूप से प्रिंट करता है।
In simple words: This code uses a 'for' loop starting from 100 and decrementing by 1 each time until it reaches 1, printing each number.

🎯 Exam Tip: Pay close attention to loop initialization (i = 100), condition (i >= 1), and update expression (i--) for reverse loops.

 

Question 4. C++ फंक्शन के केवल उस प्रोग्राम खण्ड को लिखें, जिसका नाम औसत है और जो प्रथम 20 अंकों का योग व औसत 'do-while' लूप का प्रयोग करके निकालिए। [2012]
Answer: प्रथम 20 अंकों का योग और औसत ज्ञात करने के लिए 'do-while' लूप का प्रोग्राम खण्ड निम्नलिखित है:
void Average ( )
{
    int sum = 0, i = 1;
    float avg;
    do
    {
        sum = sum + i;
        i++;
    } while (i <= 20);
    avg = sum / 20.0;
    std::cout << "The sum is " << sum << std::endl;
    std::cout << "The average is " << avg << std::endl;
}

यह फंक्शन निश्चित रूप से पहले 20 प्राकृतिक संख्याओं का सटीक योग और औसत गणना प्रदान करता है।
In simple words: A 'do-while' loop runs at least once, adding numbers from 1 to 20 to the sum variable, and then dividing the total sum by 20 to find the average.

🎯 Exam Tip: Remember to use a float division (like 20.0 or casting) to prevent integer truncation when calculating averages.

 

लघु उत्तरीय प्रश्न II (3 अंक)

 

Question 1. strcat( ) व strcpy( ) फंक्शनों को उदाहरण सहित समझाइए। [2004]
Answer: strcat() तथा strcpy() दोनों ही महत्वपूर्ण स्ट्रिंग फंक्शन हैं:

  • strcat( ): यह फंक्शन दो स्ट्रिंग्स (strings) को आपस में जोड़ने (concatenation) के लिए प्रयोग किया जाता है।
  • strcpy( ): इस फंक्शन का प्रयोग एक स्ट्रिंग को दूसरी स्ट्रिंग में कॉपी करने के लिए किया जाता है।
ये फंक्शन स्ट्रिंग मैनिपुलेशन को आसान बनाने के लिए मुख्य रूप से उपयोग किए जाते हैं।
उदाहरण:
#include <iostream.h>
#include <string.h>
#include <conio.h>
void main( )
{
    char str1[10] = "Hello";
    char str2[10] = "World";
    char str3[10];
    strcpy(str3, str1); // copies str1 into str3
    std::cout << "strcpy(str3, str1): " << str3 << std::endl;
    strcat(str1, str2); // concatenates str1 and str2 into str1
    std::cout << "strcat(str1, str2): " << str1 << std::endl;
    getch();
}

आउटपुट:
strcpy(str3, str1): Hello
strcat(str1, str2): HelloWorld
In simple words: strcpy copies text from one container to another, while strcat joins two separate texts together to make them one continuous word.

🎯 Exam Tip: Always include the string.h header file when using standard string functions like strcpy() and strcat().

 

Question 2. रिकर्सिव फंक्शन को उदाहरण सहित समझाइए।
Answer: जब कोई फंक्शन अपनी परिभाषा में स्वयं को ही कॉल करता है, तो ऐसी स्थिति को रिकर्सन कहा जाता है और ऐसे फंक्शन को रिकर्सिव फंक्शन कहा जाता है। यह जटिल गणितीय श्रृंखलाओं को हल करने में बहुत सहायक सिद्ध होता है।
उदाहरण (Fibonacci Series):
#include <iostream.h>
int fibonacci(int i)
{
    if (i == 0) return 0;
    if (i == 1) return 1;
    return fibonacci(i - 1) + fibonacci(i - 2);
}
void main( )
{
    for (int i = 0; i < 10; i++)
    {
        std::cout << fibonacci(i) << " ";
    }
}

आउटपुट: 0 1 1 2 3 5 8 13 21 34
In simple words: A recursive function is like a mirror reflecting a mirror—it keeps calling itself with smaller values until it hits a base condition to stop.

🎯 Exam Tip: A recursive function must always have a base condition to prevent it from running into an infinite loop and crashing the program.

 

Question 3. हैडर फाइल का संक्षिप्त वर्णन कीजिए। [2012]
Answer: C++ में, फाइल स्टैण्डर्ड फंक्शन्स को संग्रहीत करती है, जिसे यूजर अपने प्रोग्राम में प्रयोग कर सकता है, हैडर फाइल कहलाती है। प्रत्येक हैडर फाइल के पास एक्सटेंशन नाम '.h' होता है। ये कंपाइलर को बताते हैं कि कौन से बाहरी कार्य पहले से ही परिभाषित हैं।
कुछ प्रमुख हैडर फाइलें इस प्रकार हैं:

(i) stdio.h - यह हैडर फाइल इनपुट/आउटपुट फंक्शन्स का समूह होती है; जैसे gets(), puts() आदि।
(ii) ctype.h - यह हैडर फाइल उन फंक्शन्स को संग्रहीत करती है, जो कैरेक्टर को बदलने और जाँचने के लिए प्रयोग किए जाते हैं; जैसे isalnum(), tolower() आदि।
(iii) string.h - यह हैडर फाइल एक से अधिक स्ट्रिंग मैनिपुलेशन फंक्शन्स को संग्रहीत करती है; जैसे strcmp(), strlen() आदि।
(iv) math.h - इस हैडर फाइल के पास एक से अधिक फंक्शन्स का समूह होता, जो अर्थमैटिक गणनाएँ करने के लिए प्रयोग किए जाते हैं; जैसे sin(), fabs() आदि।
(v) stdlib.h - यह हैडर फाइल सामान्यतः प्रयोग होने वाले फंक्शन्स को डिक्लेयर करती है; जैसे कन्वर्शन, सर्च/सॉर्ट आदि।
In simple words: Header files are pre-written libraries containing built-in tools (functions) that we can import to handle text, math, inputs, and outputs easily.

🎯 Exam Tip: List at least three standard header files along with their basic purpose and example functions to score full marks.

 

Question 4. फंक्शन ओवरलोडिंग क्या है? उदाहरण सहित समझाइए। [2016, 15, 10, 08]
Answer: फंक्शन ओवरलोडिंग का अर्थ है कि किसी एक फंक्शन नाम से विभिन्न परिस्थितियों में विभिन्न कार्य कराना, जिससे एक फंक्शन के कोड को पुनः नहीं लिखना पड़ता और समय की बचत होती है। इसका प्रयोग करके हम फंक्शन को समान नाम से किन्तु अलग-अलग argument list से डिक्लेयर तथा परिभाषित कर सकते हैं। यह बहुरूपता (Polymorphism) का एक बेहतरीन उदाहरण है।
उदाहरण:
#include <iostream.h>
#include <conio.h>
void sum(int, int);
void sum(float, float);
void main()
{
    sum(8, 6);
    sum(2.2f, 3.5f);
    getch();
}
void sum(int a, int b)
{
    std::cout << "sum is " << (a + b) << std::endl;
}
void sum(float c, float d)
{
    std::cout << "sum is " << (c + d) << std::endl;
}

आउटपुट:
sum is 14
sum is 5.7
In simple words: Function overloading allows multiple functions to share the exact same name as long as they accept different types or numbers of inputs.

🎯 Exam Tip: Remember that functions cannot be overloaded solely based on different return types; the parameters must differ.

 

दीर्घ उत्तरीय प्रश्न (5 अंक)

 

Question 1. स्टैटिक वैरिएबल किस प्रकार अन्य वैरिएबल से भिन्न है? उदाहरण सहित समझाइए।
Answer: किसी वैरिएबल के प्रारम्भ में यदि static की-वर्ड लगा होता है, तो उसे स्टैटिक वैरिएबल कहते हैं। स्टैटिक वैरिएबल केवल एक बार डिक्लेयर किए जाते हैं तथा उनकी वैल्यू स्थिर (retain) रहती है। सामान्य लोकल वैरिएबल्स की तरह यह ब्लॉक से बाहर निकलने पर नष्ट नहीं होते।
उदाहरण: स्टैटिक वैरिएबल द्वारा वैल्यू प्रिण्ट करना
#include <iostream.h>
#include <conio.h>
void counter( )
{
    static int count = 0;
    std::cout << count++ << " ";
}
int main()
{
    clrscr();
    for (int i = 0; i < 5; i++)
    {
        counter();
    }
    getch();
}

आउटपुट: 0 1 2 3 4

उदाहरण: बिना स्टैटिक वैरिएबल द्वारा वैल्यू प्रिण्ट करना
#include <iostream.h>
#include <conio.h>
void counter( )
{
    int count = 0;
    std::cout << count++ << " ";
}
int main()
{
    clrscr();
    for (int i = 0; i < 5; i++)
    {
        counter();
    }
    getch();
}

आउटपुट: 0 0 0 0 0
In simple words: A static variable remembers its previous value even after its host function finishes executing, whereas normal variables get reset every single time.

🎯 Exam Tip: Use comparative code examples (with and without 'static') to clearly demonstrate the difference in lifetime and memory retention.

 

Question 2. फंक्शन का प्रयोग करते हुए C++ में एक प्रोग्राम लिखिए, जो दिए गए अंकों में से सबसे बड़ा व सबसे छोटा अंक प्राप्त करें। [2016]
Answer: दो अंकों की तुलना करने तथा उनमें से सबसे बड़ा व सबसे छोटा अंक प्राप्त करने का प्रोग्राम निम्नलिखित है:
#include <iostream.h>
#include <conio.h>
int largest (int x, int y);
void main( )
{
    int a, b;
    std::cout << "Enter the first number: ";
    std::cin >> a;
    std::cout << "Enter the second number: ";
    std::cin >> b;
    largest(a, b);
    getch( );
}
int largest (int a, int b)
{
    if(a > b)
        std::cout << "The first number is greater and second is smaller";
    else
        std::cout << "The second number is greater and first is smaller";
    return 0;
}

आउटपुट:
Enter the first number: 8
Enter the second number: 5
The first number is greater and second is smaller
यह प्रोग्राम उपयोगकर्ता द्वारा प्रविष्ट किए गए मानों के आधार पर सटीक और त्वरित निर्णय लेता है।
In simple words: This code takes two numbers as input from the user, compares them using a custom function with basic conditions, and prints which one is larger.

🎯 Exam Tip: Practice writing clear function prototypes at the top of your program and defining them properly below the main function.

UP Board Solutions Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग

Students can now access the UP Board Solutions for Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग prepared by teachers on our website. These solutions cover all questions in exercise in your Class 12 Computer Science textbook. Each answer is updated based on the current academic session as per the latest UP Board syllabus.

Detailed Explanations for Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग

Our expert teachers have provided step-by-step explanations for all the difficult questions in the Class 12 Computer Science chapter. Along with the final answers, we have also explained the concept behind it to help you build stronger understanding of each topic. This will be really helpful for Class 12 students who want to understand both theoretical and practical questions. By studying these UP Board Questions and Answers your basic concepts will improve a lot.

Benefits of using Computer Science Class 12 Solved Papers

Using our Computer Science solutions regularly students will be able to improve their logical thinking and problem-solving speed. These Class 12 solutions are a guide for self-study and homework assistance. Along with the chapter-wise solutions, you should also refer to our Revision Notes and Sample Papers for Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग to get a complete preparation experience.

FAQs

Where can I find the latest UP Board Solutions Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग for the 2026 27 session?

The complete and updated UP Board Solutions Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग is available for free on StudiesToday.com. These solutions for Class 12 Computer Science are as per latest UP Board curriculum.

Are the Computer Science UP Board solutions for Class 12 updated for the new 50% competency-based exam pattern?

Yes, our experts have revised the UP Board Solutions Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग 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.

How do these Class 12 UP Board solutions help in scoring 90% plus marks?

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 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग will help students to get full marks in the theory paper.

Do you offer UP Board Solutions Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग in multiple languages like Hindi and English?

Yes, we provide bilingual support for Class 12 Computer Science. You can access UP Board Solutions Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग in both English and Hindi medium.

Is it possible to download the Computer Science UP Board solutions for Class 12 as a PDF?

Yes, you can download the entire UP Board Solutions Class 12 Computer Science Chapter 12 फ़ंक्शन और फ़ंक्शन ओवरलोडिंग in printable PDF format for offline study on any device.