Call by Value & Call By Reference In C: C Tutorial In Hindi #31

preview_player
Показать описание
In this series of C programming tutorial videos, I have explained you everything you need to know about C language. I hope you are enjoying this C course in Hindi.

Best Hindi Videos For Learning Programming:

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

Harry while explaining Rocket Science: Isme koi rocket science nahin hai!

rajivdwivedi
Автор

Harry bro ans. of your challenge,
I am late but not wrong

#include<stdio.h>

int change(int *a, int *b)
{
*a=*a+*b, *b=*a-*b*2;
}

int main()
{int x=10, y=7;
printf("two values %d %d\n", x, y);
change(&x, &y);
printf("%d %d", x, y);
}

loveshkumrawat
Автор

Kya baat hai bro itne acche se explain karte ho aap ekdam top notch

ravivarmaravivarma
Автор

Harry bhai you are awesome...

#include <stdio.h>
int sum(int *a, int *b)
{
*a = 67+55;
*b = 67-55;
}

int main()
{
int a, b;
a = 67;
b = 55;
printf("The value of a is %d\n", a);
printf("And the value of b is %d\n", b);
sum(&a, &b);
printf("Now the value of a is %d\n", a);
printf("And The value of b is %d", b);

return 0;
}

bullishtrender
Автор

Hi harry, I am 3 years late to find you on youtube. I am preparing for competitive exams. Your teaching language is straightforward I can understand every word in your videos. anyway, today I accepted you as my programming teacher.

hanumanaramsuthar
Автор

Quiz(Given two numbers a and b, add them then subtract them to a and b using call by reference.)

#include <stdio.h>

void ADDSUB(int *a, int *b)
{
int temp;
temp = *a;
*a = *a + *b;
*b = temp - *b;
return ;
}

int main ()
{
int a=4, b=3;
printf("tha value of a is %d and the value of b is %d\n", a, b);
ADDSUB(&a, &b);
printf("now thw value of a is %d and the value of b is %d", a, b);
return 0;
}

popartist_alok
Автор

//Given two no's, add them and subtract them and reassign them using call by reference approach

#include<stdio.h>
int operations( int *x, int *y)
{
int c, d;
c= *x + *y;
d= *x - *y;
*x=c;
*y=d;
return 0;
}
int main()
{
int a, b;
printf("Enter the two numbers:\n\n");
scanf("%d%d", &a, &b);
printf("You entered %d and %d\n\n", a, b);
operations(&a, &b);
printf("After doing required operations using call by reference, the numbers are: %d and %d\t", a, b);
printf("\n\n");
return 0;
}

adityarajsingh
Автор

Your are my favourite teacher,
and my inspiration too.

mahinpatel
Автор

Sir your teaching style is awesome.
All I want to say is I am very lucky to find this channel.
Sir, if possible, can you make playlist on competitive coding, I will be very thankful to you

gopalanand
Автор

Quiz Taking two integers after initializing them. And, after adding and subtracting the value in such a way, its value is changed into 7 and 1 by using call by reference.

satyamshahgod-kar
Автор

// Quick exercise
#include <stdio.h>
int add(int *a, int *b)
{
*a = *a + *b;
*b = *a - *b;
}
int main()
{
int a, b;
a = 4;
b = 3;
add(&a, &b);
printf("The value of a is %d\n", a);
printf("The value of b is %d", b);
return 0;
}

ankitakamthes
Автор

//CALL BY REFERENCE(Quick quiz)
#include <stdio.h>
int cbr(int *x, int *y){
*x= *x+ *y;
*y= *x- *y- *y;
}
int main()
{
int a=4, b=3;
printf("The values of a and b are %d and %d respectively\n", a, b);
cbr(&a, &b);
printf("The values of a and b are %d and %d respectively", a, b);
return 0;
}

sDa_E_
Автор

Hello Mr. Harry Sir.. I am impressed after watching 31 C programming Tutorial... Your skills are very impressive.... Thank You

merajaym
Автор

Accepted sir Abhi tkk saare accept or done karta hua aa rha hu 🥰You are Awesome..😍

CoralAbhi
Автор

Call by reference example in this i changed actual value of x and y by using pointer

#include <stdio.h>
float func1(float *a, float *b){
*a = 1.6;
*b = 1.0;

}
int main(){
float x = 12.0, y=6.0;
printf(" x before calling %f\n y before calling %f\n", x, y);
float d = func1(&x, &y);
printf(" x after calling %f\n y after calling %f\n", x, y);
}

atifmalik
Автор

challage accepted

#include <stdio.h>

void quiz(int *a, int *b)
{
int temp;
temp = *a;
*a = *a + *b;
*b = temp - *b;
}
int main()
{
int a = 4, b = 3;
printf("a = %d\n", a);
printf("b = %d\n", b);
quiz(&a, &b);
printf("Now the value of a = %d\n", a);
printf("Now the value of b = %d\n", b);

return 0;
}

deeptailor
Автор

Call by value : copy of value in different variable; then they operate on diffrent values
Call by reference : address of an variable copied & both function have same address so they can change the original value

C_o_d_e_Help
Автор

#include<stdio.h>
int main() {
printf("hello harry, nice explanation");

return 0;
}

arpitkushwah
Автор

Bro tumare jessa koi nahi!!!YOU ARE THE BEST!!!!

adinathrangnekar
Автор

void addsub(int* x, int* y)
{
int temp1=*x+*y;
int temp2=*x-*y;
printf("The value of a is %d\n", temp1);
printf("The valuebif b is %d ", temp2);
}





int main()
{
int a=4;
int b=3;

addsub(&a, &b);


return 0;
}

tejalmohod