Question
Explain the concept of call by reference, with suitable code in C for each. Give advantage and disadvantage of call by reference
Answer :
Word Count : 643
In C programming, the concept of "call by reference" allows a function to modify the value of a variable in the calling code by passing its memory address instead of the actual value. This means that any changes made to the parameter within the function will affect the original variable outside the function.
To demonstrate this concept, let's consider an example using a swap function to interchange the values of two integers.
#include <stdio.h> void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int main() { int x = 10; ______ ____ ___ ___ _________ _______ _________.
______ ____ _______ _______ ____ _______ ________ ___.
_________ __________ _________ _______ __________ ________ _________ _______ ___ _________ _______ ____.
__________ _______ ________ ________ _____ ______ _________.
___ ________ _____ _________ _____ ___ ______ _____ _________ ________ __________.
_______ _______ ______ _______ ______ _______ _______ _________ _________.
_________ ______ _____ ________ ____ ________ ____ _______ ____ ____ ________ _______.
______ _____ __________ _____ _________ _______ ________ _________ ___ ______ ___.
_______ ______ ________ _____ _________ _________ ___ ___ ________ _______.
__________ ______ _______ _________ _________ ______ ________ __________.
________ ________ ______ ___ ___ ______ _______ _____ _____ ________ ___.
________ __________ ______ ___ _________ ______ ___ _______ ________.
________ ____ ________ ______ _________ ________ ______ ___ _______ ____ _______.
______ _____ _______ ________ ______ ___ _____ _________ __________ __________ _________ _______.
____ ______ ____ ___ _____ _________.
_________ ________ ___ _______ ___ ___ __________ ____.
_________ ____ __________ ____ _______ _____ _______ ___ _________.
________ ______ ___ ____ _________ ______ ____ ________ _____ _______ ___ _____.
___ _____ _______ ______ _____ ______ _____.
_______ ___ __________ _____ ____ _____ _________ _________ ______ ________ ______.
___ _____ _______ _____ _______ _________ ___ _____ ___ ____.
________ _________ _________ ____ ___ _________ ____.
______ ______ ________ __________ ______.
__________ _________ __________ _________ ________ ____ _________ _____ ______.
_________ ____ __________ ____ _________ ____ ____ ___.
____ ___ ________ ___ _________ ___ ______ _______ ____.
___ ________ _________ _____ __________ _________ ____ ________ ____.
___ _______ __________ _______ _______.
______ _________ _________ __________ __________ ____ _____ ______ ________.
________ ________ ______ ______ __________ ____ _________ ________ _____ ___ __________.
________ ______ _________ ______ ______ ______ _____ __________ ___.
_____ ____ ____ _______ _____ ___ _____ ______ __________ _______.
_____ _________ _________ ______ _______ _________ _____ ______ __________ _________ __________ _______.
__________ _____ ____ __________ ________ ______.
______ _________ _______ _____ ________ _____.
_____ _______ ____ _____ _____ __________ ________ _______ _________ ___ ______.
_______ ____ _________ __________ ______ _____.
________ _________ _____ ________ ___ ________.
____ _____ ___ _____ _______ ____ ___ _________ _____ ______.
______ ____ ________ _____ ______ ____ ________.
____ ______ ___ ______ _____ ___ _____ _________ ___ __________.
___ ____ ___ ________ _________ _____.
_________ ______ _________ ____ _______ ______ _______ ______.
_____ __________ _________ _____ ______ _______ ______ __________ __________ __________ ___.
________ ____ _____ ________ ___ __________ ___.
____ _______ ______ ___ _________ ________ _____ ___.
_____ _________ ___ ______ __________ _________.
___ _______ _________ __________ ______ ________ ____ _____ _____ ______.
________ ______ __________ _________ _______ ____ ____.
____ __________ _______ ____ _____ _____ _________ _____.
_______ _____ _______ ________ ______ ________ _____ __________ ___.
__________ _______ _________ ________ __________ _________.
_____ ______ ___ _____ __________ ___ ______ ____ ______ __________ ______ _____.
_______ _______ ______ ________ ________ ___ _______ ______ ____.
________ _____ ___ _______ ______ ___ ____ ______ ________ _____ ___ _______.
___ ___ ____ _____ ______ ___ ____ ____ ___ _____.
___ _______ ____ _______ _______ ________ __________ ____.
______ _____ _____ __________ ___ _____ ___ ___.
_________ ____ _________ _________ __________ ___ __________ _________ _____ ______ ______.
___ ______ ___ _____ ____ _______ __________ _________.
________ _______ __________ ______ __________ _____.
Get Full Answer on WhatsApp IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★