programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program for Call By Reference

Written by: RajaSekhar
  • Basic C Programs-2
  • C Pointers

Call by Reference example code written in C Programming. The code explains how to pass address as arguments from calling function to called functions.

#include<stdio.h>
int main()
{
    int a,b,c;
    printf("Enter Two Values: ");
    scanf("%d %d",&a,&b);
    c=add(&a,&b);
    printf("The Sum is: %d",c);
    return 0;
}
add(int *x,int *y)
{
    int z;
    z=*x+*y;
    return(z);
}

 OUTPUT:

Enter Two Values: 30 20
The Sum is: 50
Previous article: C Program to Design Lexical Analyzer Prev Next article: C Program to Find Address locations of Array Elements Using Pointers Next
  • Swapping of Two Numbers Using Call By Reference in C
  • C Program to Find Number of Characters and Words in a String
  • C Program to Implement STACK Operations Using Pointers
  • C Program to Sort an Array using SELECTION SORT
  • C Program to Implement Structure with Pointers
  • C Program to Compare Two Strings using strcmp()
  • C Program to Find Sum of N Natural Numbers
  • Evaluate Algebraic Expression (ax+b)/(ax-b)
  • C Program for Insertion Sort
  • C Program to Find Sum of Individual Digits of a Positive Integer Number
  • C Program to Find Address locations of Array Elements Using Pointers
  • C Program to Find Length of a String Using STRLEN()
  • C Program to Find Given Number is Perfect or Not
  • Implementation of Stack Using Array in C
  • C Program to Sort List of Strings
  • Privacy Policy
  • Cookie Policy
© programming9.com 2026
Back to top