Call by Value vs Call by Reference in C Programming | Difference Explained with Example

Pubblicato il: 11 maggio 2026
sul canale di: Edu Paila
28
1

Call by Value vs Call by Reference in C Programming | Difference Explained with Example

In this video, we have discussed about difference between Call by Reference vs Call by Value with examples in C language.

What we have discussed:
What is Call by Value
What is Call by Reference
Difference between both
Example programs in C


------Code for Call by Reference-----

#include "stdio.h"
void fn(int *a, int *b){
*a = 50;
*b = 60;
}
int main()
{
int x = 10;
int y = 20;
fn(&x, &y);
printf("%d \n%d", x, y);
}

-------Code for Call by Value-------

#include "stdio.h"
void fn(int x, int y){
x = 50;
y = 60;
}
int main()
{
int x = 10;
int y = 20;
fn(&x, &y);
printf("%d \n%d", x, y);
}


IDE used : Dev Cpp

Learn JavaScript:
   • JavaScript Practise 2 || in Nepali  

Related Topics:
Difference between Call by Value and Call by Reference
Function calling methods


In questa pagina del sito puoi guardare il video online Call by Value vs Call by Reference in C Programming | Difference Explained with Example della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Edu Paila 11 maggio 2026, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 28 volte e gli è piaciuto 1 spettatori. Buona visione!