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

User Define Function : Nesting or Array in hindi in c language नेस्टिंग या अरे इन c कंप्यूटर भाषा

नेस्टिंग या अरे इन c कंप्यूटर भाषा User Define Function : Nesting or Array in hindi in c language :-
Function के classification मे हमने चार प्रकार के functions (No Arguments or No return values, Arguments bur no return vaue,Arguments with return value और no arguments with return value ) को पढ़ा है |

Function with more than one return

इससे पहले हमने पड़ा था की return statement से किसी एक value को return करा सकता है |लेकिन जब programmer को more than two data values को return करना होता है तब इस function को use कर सकते है |
इसमें function को call करते समय actual parameter मे किसी आउटपुट variables के अद्द्द्रेस को formal parameter मे pass करते है | इन address पर data values सेव हो जाती है जो main() function मे use कर सकते है |
उदहारण के लिए :
#include<stdio.h>
#include<conio.h.
int calculation(int a,int b,int*c,int*d)
void main()
{
int a =23,b=12,c,d;
calculation(a,b,&c,&d);
printf(“Addition of Numbers=%d\n”,c);
printf(“Multiplication of Numbers=%d”,d);
getch();
}
int(int e,intf,int*sum,int*mul)
{
sum=e+f;
mul=e*f;
}

int*sum एक pointer है जो की variable c के address को होल्ड कर रहा है |
sum=e+f; statement मे e+f; का जो आउटपुट होगा वो sum address पर store हो जायेगा inshort c के address पर store हो जायेगा |ये पूरा process mul और variable d के साथ भी होगा |
calling function calculation(a,b,&c,&d); मे variable c और d के address PASSED होगा |

आउटपुट होगा :
Addition of Numbers=35
Multiplication of Numbers=276

Nesting of function :

C language function of function को allow करता है जैसे main() function , function 1() को call करता है function 1() ,function 2() को call करता ही function 3() ,function 4() को call करता है |C language मे function की nesting की कोई limit नहीं होती है |
उदहारण के  लिए:
#include<stdio.h>
#include<conio.h.
int calculation(int a,int b)
int mul( int, int  );
void main()
{
int a =23,b=12,c,d;
c=calculation(a,b);
printf(“Output of Numbers=%d\n”,c);
getch();
}
int(int e,int f )
{
int sum ;
sum=e+mul(e,f);
return sum;
}
int mul( int i,int j )
{
int g;
g=i*j;
}

इस प्रोग्राम मे तीन function है main() ,add() और mul() |main() function , add() को call करता है और add() function , mul() को call करता है |जब sum =e+mul(e,f) execute होता  है तब mul() function की return value का addition ,e होता है |
आउटपुट होगा :
Output of Numbers=299]

Array Passing in function :

C language मे, array को function मे pass कर सकते है |array तीन प्रकार की होती है :इसलिए इसे हम तीन headings मे पड़ेगे|
1.One dimensional array :
जब किसी One dimensional array को function मे pass करते tab केवल array name को subscript के बिना ही calling statement मे pass कर देते है |इसका syntax है :
function calling: function name ( array_name, int size );
function declaration : function type (array _ name declare [], int size_variable);
उदहारण के लिए :
#include<stdio.h>
#include<conio.h>
int max(int a[],int size);
void main()
{
int a[5]={12,23,21,45,34};
int m;
m=max (a,5);
printf(“Maximum number is %d”,m);
getch ();
}
int max (int a [],int size)
{
int max=0;
for(int i=0;i<=size;i++)
{
if(max<a[i])
{
max=a[i];
}
return(max);
}
इस उदाहरण मे ,array [5] को कालिंग function statement m=max (a,5); मे pass किया गया है |इस statement मे ‘a’ array का नाम है और 5 array की size  है |
आउटपुट होगा :

Maximum number is 45

अगर user define function मे array की value मे कोई change होगा तब  वे change main array मे होता है |जब पूरी  array as formal arguments pass होती है तब उसके values pass नहीं होती |उन values के address pass  होती है |

Two -Dimensional Array :

जब किसी Two -Dimensional Array को function arguments मे pass किया जाता है tab ये syntax को फॉलो करना पड़ता है |
function calling मे, केवल array का नाम से call किया  जाता है |
syntax : function name (array _name) ;
function definition मे , array को दो brackets के साथ बताया जाता है और second subscript की value को लिखा जाता है |
syntax : function type function_name (int array_name[ ][size],int row size,int column size);
Function header का syntax one dimension array की तरह होता है |

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

#include<stdio.h>
#include<conio.h>
#define row 2
#define colunm 2
int add(int a[][colunm],int  b[][colunm]);
void main()
{
int a[row][colunm]={12,23;
                                 11,34 };
int b[row][colunm]={16,24;
                                  17,36 };
add(a,b);
getch ();
}
int max (int a [][],row,colunm,b[][],row,colunm)
{
int i,j;
int c[row][colunm];
for(i=0;i<row;i++)
{
for(j=0;j<colunm;j++)
{
c[i][j]=a[i][j]+b[i][j];
printf(“%d \t”,c[i][j]);
}
printf(“\n”);
}

आउटपुट होगा :
28   47
28   70

Sbistudy

Recent Posts

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

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

3 days ago

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

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

4 days ago

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

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

7 days ago

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

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

7 days ago

elastic collision of two particles in hindi definition formula दो कणों की अप्रत्यास्थ टक्कर क्या है

दो कणों की अप्रत्यास्थ टक्कर क्या है elastic collision of two particles in hindi definition…

7 days 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