हिंदी माध्यम नोट्स
User Define Function : Recursion or Multi file Programme in hindi in c language रिकर्शन इन हिंदी
रिकर्शन इन हिंदी User Define Function : Recursion or Multi file Programme in hindi in c language :-
Recursion : जब कोई function किसी दुसरे function को call कर सकता है |लेकिन जब कोई function खुद को बार बार call करता है tab इस प्रोसेस को recursion कहते है |Recusion प्रोसेस पर ही recusion algorithm बनी है |
if(n==1) // Base condition//
return(1);
fact=n*fact(n-1);
number 1() ;
if(n==1) // Base condition//
return(1);
fact=n*fact(n-1);
return ();
Return();
printf(“Enter charcter”);
जब किसी Recursion मे ,Recursion statement last नहीं होता है तब इसे Non tail Recursion कहते है |
string character का समूह होता है| किसी string को function के arguments मे pass करने का syntax array as argument के syntax की तरह होता है |
इसका syntax है :-
function calling मे, केवल string के नाम से call किया जाता है |
syntax : function name (string _name) ;
function definition मे , string_name से define किया जाता है |
syntax : function type function_name (char string_name[ ]);
Function header का syntax one dimension array की तरह होता है |उदाहरण के लिए :
#include<stdio.h>
#include<conio.h>
void print( char);
void main()
{
char a;
printf(“Enter your charter “);
scanf(“%c”,&a);
print(a);
getch();
}
void print( char b)
{
int i=0;
for(i=0;i<=20;i++)
{
printf(“%c”,b);
}
आउटपुट होगा :
Enter your charter #
####################
Calling Function :
किसी भी function को main() function मे call करने के दो तरीके होते है :-
1.call by value
इस प्रकार मे , arguments मे किसी variable के data value को calling function मे pass किया जाता है |user define function मे variable की value मे हुई changes का effect main() function के actual variable पर नहीं पड़ता है |
2.Call by reference
इसमें actual parameter के address formal parameter मे pass होती है |user define function मे हुई changes का effect actual parameter मे होता है |
Recent Posts
Question Tag Definition in english with examples upsc ssc ias state pcs exames important topic
Question Tag Definition • A question tag is a small question at the end of a…
Translation in english grammer in hindi examples Step of Translation (अनुवाद के चरण)
Translation 1. Step of Translation (अनुवाद के चरण) • मूल वाक्य का पता करना और उसकी…
Report Writing examples in english grammer How to Write Reports explain Exercise
Report Writing • How to Write Reports • Just as no definite rules can be laid down…
Letter writing ,types and their examples in english grammer upsc state pcs class 12 10th
Letter writing • Introduction • Letter writing is an intricate task as it demands meticulous attention, still…
विश्व के महाद्वीप की भौगोलिक विशेषताएँ continents of the world and their countries in hindi features
continents of the world and their countries in hindi features विश्व के महाद्वीप की भौगोलिक…
भारत के वन्य जीव राष्ट्रीय उद्यान list in hin hindi IAS UPSC
भारत के वन्य जीव भारत में जलवायु की दृष्टि से काफी विविधता पाई जाती है,…