Short note : Passing arguments to Function in hindi

0 Deepak
Short note : Passing arguments to Function in hindi

Index(toc)

Passing arguments in hindi

जब एक function से दूसरे function में argumemt (value) pass किया जाता है तो उसे passing argument कहा जाता है।

Types of Passing arguments

1. No return no argument
2. No return argument
3. Return no argument
4. Return and argument

No return no argument

इनमें न तो कोई value return किया जाता है और न ही accept किया जाता है। इनमें input function definition के बाद देते हैं।

Program

 #include<iostream.h>  
 #include<conio.h>  
 void sum();  
 void man()  
 {  
  clrscr();  
 sum();  
 getch();  
 }  
 void sum()  
 {  
  int n1,n2,sum1;  
 cout<<"enter number";  
 cin>>n1>>n2;  
 sum=n1+n2;  
 cout<<"the sum is "<<sum1;  
 }  

No return argument

इसमें value return नहीं होता लेकिन argument pass होता है।

Program

 #include<iostream.h>  
 #include<conio.h>  
 void sum(int, int)  
 {  
  int n1,n2;  
 clrscr();  
 cout<<"Enter num";  
 cin>>n1>>n2;  
 sum(n1,n2);  
 getch();  
 }  
 void main(int a, int b)  
 {  
  int c;  
 c=a+b;  
 cout<<"the sum is "<<c;  
 }  

Return no argument

इसमें value return तो होता है लेकिन argument pass नहीं किया जाता है।

Program

 #include<iostream.h>  
 #include<conio.h>  
 int sum()  
 {  
  int res;  
 clrscr();  
 res<<"The sum is "<<rees;  
 getch();  
 }  
 int sum()  
 {  
 int n1, n2, sum 10;  
 cout<<"enter num";  
 cin>>n1>>n2;  
 sum=n1+n2;  
 return sum1;  
 }  

Return and argument

इसमें value return होता है तथा argument भी pass किया जाता है।

Program

 #include<iostream.h>  
 #include<conio.h>  
 int sum(int, int)  
 void sum()  
 {  
  int n1,n2;  
 clrscr();  
 cout<<"enter num";  
 cin>>n1>>n2;  
 res= sum(n1,n2);  
 cout<<"the sum is"<<res;  
 getch();  
 int sum(int a, int b)  

लेख पसंद आया हो तो इसे जरूर शेयर करें.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Out
Ok, Go it!