JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: C Language in hindi

what is User Define Function : Importance or Definition in hindi in c language कंप्यूटर भाषा

कंप्यूटर भाषा में यूजर डिफाइन फंक्शन क्या है , what is User Define Function : Importance or Definition in hindi in c language :-
function,C language का powerful toll है क्योकि इसे declare और use करना सरल है |किसी C प्रोग्राम मे main(),printf() और scanf() मुख्य functions है |इस article मे :
1. Function कैसे design होता है ?
2. Function को कैसे प्रोग्रम से लिंक करते है ?
3. दो या दो अधिक functions को कैसे जोड़े ?
4. ये functions कैसे data transfer करते है ?C function दो प्रकार से classified किया गया है :-
Library Function : ये Pre Define function होता है ये header file मे store होता है |इसे किसी प्रोग्रम मे  function calling करके use कर सकते है |जैसे :
math.h : cosh (x),pow((x,y) आदि |
stdio.h : printf() ,scanf() आदि |
string.h : strstr(),strlen() आदि |
User Define Function : ये यूजर define होगा |जैसे :
main () function.

Main():

Main () ये indicate है प्रोग्राम का starting point जहा  से प्रोग्राम execute होगा |किसी भी code को सिर्फ main() function से execute कर सकते है लेकिन  main() की length बड़ी और complex होगी तबdebugging ,running और testing मे difficulty होती है |Function मे अलग अलग parts होते है जो अलग अलग  execute होते है बाद मे combine होते है |
User Define Function की Need :
1. इसमें प्रोग्राम subprogram मे डिवाइड हो जाता है इसलिए time complexity कम हो जाती है |
2.किसी specific functions को repeat करना easy हो जाता है |

C Program का Approach :
जब किसी C प्रोग्राम मे दो या दो से अधिक functions होते  है तब्ब प्रोग्राम दो प्रकार से RUN होता है :-
1.Top-Down Prograameing 
इस प्रोग्रामिंग स्टाइल मे , complex और high level code पहले solve होते है और lower level function की डिटेल्स को बाद मे address किया जाता है |
इस स्टाइल मे , long प्रोग्राम की length को function से कम कर सकते है |लेकिन माइक्रो कंप्यूटर के लिए ये fact फिट नहीं होता है क्योकि माइक्रो कंप्यूटर मे space redution main होती है |
इस स्टाइल  मे faulty function को easily find किया जा सकता है |
उदहारण के लिए :
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b.c;
printf(” Enter two values “);
scanf(“%d %d”,&a,&b);
c=add(a,b);
printf(“Add =%d”,c);
getch();
}
int main( int r,int f)
{
int sum;
sum=r+f;
return sum;
}
इस प्रोग्राम मे main function को पहले declare किया गया है और main() function ही पहले execute होगा |
add() function बाद मे होगा |

Bottom -Up Style :
ये स्टाइल high level कंप्यूटर languages(c++,JAVA आदि ) मे use होती है |इसमें subprograme पहले design होते है बाद मे main(0 function का exucation होता है |
#include<stdio.h>
#include<conio.h>
int main( int r,int f)
{
int sum;
sum=r+f;
return sum;
}
void main()
{
int a,b.c;
printf(” Enter two values “);
scanf(“%d %d”,&a,&b);
c=add(a,b);
printf(“Add =%d”,c);
getch();
}

इस प्रोग्राम मे add() function main() function से पहले execute होगा |

Function Definition :
User Define Function बनाने के लिए , तीन प्रकार operation मुख्य होते है :-
1.Function Defination
Function को define करने से मतलब है function के लॉजिक को syntax मे व्यस्थित करना है |कभी कभी इसे function implementation भी कहते है |इसके सात भाग मुख्य होते है |ये सात भाग भी two group मे डिवाइड होते है |
1. function Header
2. function Body

function header मे function name,function type और parameter list आते है |
1. function Name और Type :
Function Type ये define करता है function के आउटपुट का datatype कोनसा होगा जो main function मे return होगा |
function name उस function का नाम, होता है जो C language के rules को फॉलो करना कहिये जैसे duplication नहीं होना चाहिए |
जब कोई function कोई value return नहीं करता तब उसका type void होता है जिसका मतलब है No Return Values |

2Function Parameter
इसे formal parameter भी कहते है |इस variables मे ,function calling के समय जो variable pass किये गये होगे use assign करता है |इसके बारे मे हम आगे के article मे पढ़गे |
सभी variables को comma से deferential करते है |अगर कोई भी variable pass नहीं होता तब void लिखना जरुरी होता है |

Function Body :
ये सभी executable statements और declaration को रखता है ये {} से क्लोज होता है इसके तीन parts होते है :
Variable Declaration : इसमें सभी local variable को declare किया जाता है ज्जिन्हे केवल उसी function मे use कर सकते है |
Function Statements : इसमें सभी statements को लिखा जाता है |
Return : इसमें function के लॉजिक से मिला आउटपुट को return किया जाता है जिसे main() मे use किया जाता है |

Return Statement को हम age article मे पड़ेगे |

उदहारण के लिए :

int add (int c,int d)  // function type:int,function name: add , Paratmeter: int a,int b//
{                              // Function body start //

int sum ;                // local variable declaration //

sum=a+b;             // Statement//

return sum;          //  return statement//

}                           // function Body close//

इस function का datatype int है क्योकि sum का datatype integer है जो की main()  फ़ुन्क्तिओन्न मे return हो रही है |

function,C language का powerful toll है क्योकि इसे declare और use करना सरल है |किसी C प्रोग्राम मे main(),printf() और scanf() मुख्य functions है |इस article मे :
1. Function कैसे design होता है ?
2. Function को कैसे प्रोग्रम से लिंक करते है ?
3. दो या दो अधिक functions को कैसे जोड़े ?
4. ये functions कैसे data transfer करते है ?

C function दो प्रकार से classified किया गया है :-
Library Function : ये Pre Define function होता है ये header file मे store होता है |इसे किसी प्रोग्रम मे  function calling करके use कर सकते है |जैसे :
math.h : cosh (x),pow((x,y) आदि |
stdio.h : printf() ,scanf() आदि |
string.h : strstr(),strlen() आदि |
User Define Function : ये यूजर define होगा |जैसे :
main () function.


Main():


Main () ये indicate है प्रोग्राम का starting point जहा  से प्रोग्राम execute होगा |किसी भी code को सिर्फ main() function से execute कर सकते है लेकिन  main() की length बड़ी और complex होगी तबdebugging ,running और testing मे difficulty होती है |Function मे अलग अलग parts होते है जो अलग अलग  execute होते है बाद मे combine होते है |


User Define Function की Need :
1. इसमें प्रोग्राम subprogram मे डिवाइड हो जाता है इसलिए time complexity कम हो जाती है |
2.किसी specific functions को repeat करना easy हो जाता है |

C Program का Approach :
जब किसी C प्रोग्राम मे दो या दो से अधिक functions होते  है तब्ब प्रोग्राम दो प्रकार से RUN होता है :-
1.Top-Down Prograameing 
इस प्रोग्रामिंग स्टाइल मे , complex और high level code पहले solve होते है और lower level function की डिटेल्स को बाद मे address किया जाता है |
इस स्टाइल मे , long प्रोग्राम की length को function से कम कर सकते है |लेकिन माइक्रो कंप्यूटर के लिए ये fact फिट नहीं होता है क्योकि माइक्रो कंप्यूटर मे space redution main होती है |
इस स्टाइल  मे faulty function को easily find किया जा सकता है |
उदहारण के लिए :
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b.c;
printf(” Enter two values “);
scanf(“%d %d”,&a,&b);
c=add(a,b);
printf(“Add =%d”,c);
getch();
}
int main( int r,int f)
{
int sum;
sum=r+f;
return sum;
}
इस प्रोग्राम मे main function को पहले declare किया गया है और main() function ही पहले execute होगा |
add() function बाद मे होगा |

Bottom -Up Style :
ये स्टाइल high level कंप्यूटर languages(c++,JAVA आदि ) मे use होती है |इसमें subprograme पहले design होते है बाद मे main(0 function का exucation होता है |
#include<stdio.h>
#include<conio.h>
int main( int r,int f)
{
int sum;
sum=r+f;
return sum;
}
void main()
{
int a,b.c;
printf(” Enter two values “);
scanf(“%d %d”,&a,&b);
c=add(a,b);
printf(“Add =%d”,c);
getch();
}

इस प्रोग्राम मे add() function main() function से पहले execute होगा |

Function Definition :
User Define Function बनाने के लिए , तीन प्रकार operation मुख्य होते है :-
1.Function Defination
Function को define करने से मतलब है function के लॉजिक को syntax मे व्यस्थित करना है |कभी कभी इसे function implementation भी कहते है |इसके सात भाग मुख्य होते है |ये सात भाग भी two group मे डिवाइड होते है |
1. function Header
2. function Body

function header मे function name,function type और parameter list आते है |
1. function Name और Type :
Function Type ये define करता है function के आउटपुट का datatype कोनसा होगा जो main function मे return होगा |
function name उस function का नाम, होता है जो C language के rules को फॉलो करना कहिये जैसे duplication नहीं होना चाहिए |
जब कोई function कोई value return नहीं करता तब उसका type void होता है जिसका मतलब है No Return Values |

2Function Parameter
इसे formal parameter भी कहते है |इस variables मे ,function calling के समय जो variable pass किये गये होगे use assign करता है |इसके बारे मे हम आगे के article मे पढ़गे |
सभी variables को comma से deferential करते है |अगर कोई भी variable pass नहीं होता तब void लिखना जरुरी होता है |

Function Body :
ये सभी executable statements और declaration को रखता है ये {} से क्लोज होता है इसके तीन parts होते है :
Variable Declaration : इसमें सभी local variable को declare किया जाता है ज्जिन्हे केवल उसी function मे use कर सकते है |
Function Statements : इसमें सभी statements को लिखा जाता है |
Return : इसमें function के लॉजिक से मिला आउटपुट को return किया जाता है जिसे main() मे use किया जाता है |

Return Statement को हम age article मे पड़ेगे |

उदहारण के लिए :

int add (int c,int d)  // function type:int,function name: add , Paratmeter: int a,int b//
{                              // Function body start //

int sum ;                // local variable declaration //

sum=a+b;             // Statement//

return sum;          //  return statement//

}                           // function Body close//

इस function का datatype int है क्योकि sum का datatype integer है जो की main()  फ़ुन्क्तिओन्न मे return हो रही है |

Sbistudy

Recent Posts

द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi

अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…

19 hours ago

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

4 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

5 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

1 week ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

1 week ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now