call by reference

/* function definition to swap the values */
void swap(int *x, int *y) {

   int temp;
   temp = *x;    /* save the value at address x */
   *x = *y;      /* put y into x */
   *y = temp;    /* put temp into y */
  
   return;
}

4.22
9
Krish 100200 points

                                    //Call By Reference

#include<stdio.h>
void function(int *, int *);       //function declaration
int main()
{
	int a,b;
    
    printf("Enter first number: ");
    scanf("%d",&a);
    printf("Enter second number: ");
    scanf("%d",&b);
    
    function(&a,&b);    //passing the address of both the variables( CALL BY REFERENCE)

}
void function(int *p,int *q)     //function defination
{
   printf("printing variables from function a=%d b=%d",*p,*q);
}
//code by Dungriyal..

4.22 (9 Votes)
0
3.67
3
Awgiedawgie 440220 points

                                    /* function definition to swap the values */
void swap(int *x, int *y) {

   int temp;
   temp = *x;    /* save the value at address x */
   *x = *y;      /* put y into x */
   *y = temp;    /* put temp into y */
  
   return;
}

3.67 (3 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
Call by Reference and Return by Reference? what is call by reference and call by value What is call by reference in functions what is call by reference and call by value with examples call by reference example?? explain call by value and call by reference? Differentiate call by value and call by reference. Call by Reference - Return by reference differentiate between call by value and call by reference call by value call by reference example call by reference in reference call-by reference call by reference meaning Difference between call by value and call by reference. what is call by value and call by reference in programming Concept of call by value and call by reference What is difference between call by value and call by reference for functions. What is call by reference and call by value? call by reference means call by name call by reference call by value and reference demonstrate call by value and call by reference what is difference between call by value and call by reference difference between call by value and call by reference call by reference & call by reference& call by reference vs call by value call by reference calll by value how does call by reference work call by value and call by reference-where to use how to call by reference call by reference example , Call by Reference, explain call by value and call by reference with example call by reference c example call by value vs call by reference function call by reference example in c guru99 call by reference means? call by reference call by value when call by reference reference a method in a variable c call by value call by reference if there is parameter by reffrence in an function and there is another function inside that function to to give reference what is call by value and call by reference function call by reference reference metho in functions c how to pass a variable by reference in c c function call by reference call be reference in c how to reference a function in c Call and Return by reference function prototype, int add (int *); function calls is “call by reference”. c call function by reference call by refrence pass by reference cp function call as reference call by reference and call by value call by referece passing by reference in c Call by value & call by reference assign by reference c pass a reference to function c++ call by reference in c language c call by reference call by function call by refence call by reference c function call c function in c pass by reference how to refer by value in c add two numbers using call by reference in tutorialspoint Call by Value and Call by Reference function passing by reference in c call by address program in c copy by reference c callesc function call by reference in main call by reference in c++ prototype function c program call by reference call by value and call by reference in c pass by refrence in c passa by reference for functions in c how to pass by reference in c how to pass a reference to a function c c pass by reference function reference in c what is call by reference call by reference in c pass by reference in c Explain working of call by reference function invoking. what is a reference in c call by reference example in c pass by reference c call by reference
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source