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
  • C program to find Sum of Digits of a Positive Integer Number
  • C Program to ADD two MATRICES
  • C program to Implement BREAK Statement
  • C Program to Find Second Largest Number in an Array
  • C Program to Compare Two Strings using strcmp()
  • C Program to Find Prime Factors of a Given Positive Number
  • C Program to Implement Structure with Pointers
  • C Program to convert Celsius to Fahrenheit
  • C Program to Implement Structure with Array
  • C Program to Find Sub String Position in Given String
  • C Program for Addition of Two Numbers
  • C Program to INSERT a Sub-String in Main String at Given Position
  • C Program to Check Given Number is PRIME or Not
  • C Program to Find Given Number is Perfect or Not
  • C program to Print Triangle Pattern
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top