Video není dostupné.
Omlouváme se.

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

Sdílet
Vložit
  • čas přidán 14. 05. 2019
  • 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.
    ►This C Lecture is a part of this C Programming Course: • C Language Tutorials I...
    ►Source Code + Notes: codewithharry....
    ►Click here to subscribe - / @codewithharry
    Best Hindi Videos For Learning Programming:
    ►Learn Python In One Video - • Learn Python In Hindi ...
    ►Learn JavaScript in One Video - • JavaScript Tutorial
    ►Learn PHP In One Video - • Learn Php In One Video...
    ►Machine Learning Using Python - • Machine Learning Tutor...
    ►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
    ►Advanced Python Tutorials - • Intermediate/Advanced ...
    ►Object Oriented Programming In Python - • Object Oriented Progra...
    ►Python Data Science and Big Data Tutorials - • Python Data Science an...
    Follow Me On Social Media
    ►Website (created using Flask) - www.codewithha...
    ►Facebook - / codewithharry
    ►Instagram - / codewithharry
    ►Personal Facebook A/c - / geekyharis
    Twitter - / haris_is_here

Komentáře • 739

  • @rajivdwivedi6353
    @rajivdwivedi6353 Před 3 lety +333

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

  • @legendarychest1630
    @legendarychest1630 Před 5 lety +182

    /*Author: Md Shoaib
    Purpose: Quiz(Given two numbers a and b, add them then subtract them to a and b using call by reference.)
    Date: 09/07/2019 */
    #include
    //fuction(Call by reference) for add or subtract
    void addSub(int *a1, int *b1)
    {
    int temp;
    temp = *a1;
    *a1 = *a1 + *b1;
    *b1 = temp - *b1;
    return;
    }
    int main()
    {
    //variable declaration
    int a = 8, b = 6;
    //print to user
    printf("Before running the function, the value of a = %d and value of b = %d
    ", a, b);
    //function call for change the values
    addSub(&a, &b);
    //after using function print to user
    printf("After running the function, the value of a = %d and value of b = %d
    ", a, b);
    return 0;
    }

    • @biswajitsamant6588
      @biswajitsamant6588 Před 3 lety +6

      bhai tum to heavy coder nikle 😂😂😂😉😉😉😉😉😉😉

    • @ftn1541
      @ftn1541 Před 3 lety +1

      niceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

    • @alkalinelife6110
      @alkalinelife6110 Před 3 lety +3

      bhai ek number code likha h mene VS code me run kiya , or yeh code run bhi hua

    • @bsk3800
      @bsk3800 Před 3 lety +1

      @@alkalinelife6110 ✌🏾

    • @dikshantprajapat105
      @dikshantprajapat105 Před 3 lety +1

      👍👍👍👍

  • @loveshkumrawat
    @loveshkumrawat Před 4 lety +8

    Harry bro ans. of your challenge,
    I am late but not wrong
    #include
    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
    ",x,y);
    change(&x,&y);
    printf("%d %d",x,y);
    }

  • @hanumanaramsuthar
    @hanumanaramsuthar Před rokem +42

    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.

  • @adityarajsingh842
    @adityarajsingh842 Před 2 lety +14

    //Given two no's, add them and subtract them and reassign them using call by reference approach
    #include
    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:

    ");
    scanf("%d%d",&a,&b);
    printf("You entered %d and %d

    ", a, b);
    operations(&a,&b);
    printf("After doing required operations using call by reference,the numbers are: %d and %d\t",a,b);
    printf("

    ");
    return 0;
    }

  • @sDa_E_23
    @sDa_E_23 Před 2 lety +14

    //CALL BY REFERENCE(Quick quiz)
    #include
    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
    ", a, b);
    cbr(&a, &b);
    printf("The values of a and b are %d and %d respectively", a, b);
    return 0;
    }

    • @physicsboy5762
      @physicsboy5762 Před 2 lety +3

      //CALL BY REFERENCE(Quick quiz)
      #include
      int cbr(int *x, int *y){
      int temp = *x;
      *x= *x+ *y;
      *y= temp- *y;
      }
      You can also do this

    • @jimmoriarty5993
      @jimmoriarty5993 Před rokem +1

      Why do you subtracted y 2 times???😮

  • @ravivarmaravivarma2731
    @ravivarmaravivarma2731 Před 4 lety +19

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

  • @sagnikroy5001
    @sagnikroy5001 Před 4 lety +31

    #include
    /* Quick Quiz:
    Given two numbers a and b, add them then subtract them and assign them to a and b using call by reference.
    a = 4
    b = 3
    after running the function, the values of a and b should be:
    a = 7
    b = 1
    */
    void callbyref(int *x, int *y)
    {
    *x=*x+*y;
    *y=(*x-*y)-*y;
    }
    int main()
    {
    int a,b;
    printf("Enter value of a and b: ");
    scanf("%d%d",&a,&b);
    callbyref(&a,&b);
    printf("The values of a=%d and b=%d",a,b);
    return 0;
    }

  • @gopalanand1527
    @gopalanand1527 Před 4 lety +27

    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

  • @gordon_x47
    @gordon_x47 Před 2 lety +17

    #include
    int operation(int* x, int* y){
    int c;// declaring a local variable.
    c= *x + *y; // adding the value of pointers and assigning them into c.
    int d; // declaring a local variable.
    d = *x - *y; // subtracting the value of pointers and assigning them into d.
    *x = c; // assigning the value of c into pointer x.
    *y = d; // assigning the value of d into pointer y.
    }
    int main()
    {
    int a=4, b=3;
    printf("The values of a and b before calling the function are: %d and %d
    ", a, b);
    operation(&a, &b);
    printf("The values of a and b after using the operation function are: %d and %d
    ", a, b);
    return 0;
    }
    //Love you Harry Bhai.

    • @rockygaming3663
      @rockygaming3663 Před rokem +1

      //Bro can u explain what does return 0 indicate
      //if it doesn't return anything what's the purpose of writing it??;

    • @gordon_x47
      @gordon_x47 Před rokem +1

      @@rockygaming3663 return 0 means program has successfully executed. Because a function has to return a value if it doesn't returns then it is interpreted that the program is incomplete so we write return 0 to return a value to the program.😊✌️ Hope you get it and good luck on your learning journey, I learned from this course now I'm studying java from Harry Sir.👍

  • @GOATSOFFOOTBALL
    @GOATSOFFOOTBALL Před rokem +2

    #include
    void fun(int *a,int *b)
    {

    int temp;
    temp=*a;
    *a=(*a+*b);
    *b=(temp-*b);
    }
    int main()
    {
    int a,b;
    printf("enter the values of a and b: ");
    scanf("%d%d",&a,&b);
    fun(&a,&b);
    printf("the value of a is %d and b is %d",a,b);
    }
    thanks bhaiya for teaching this concept so easily to make us understand

  • @popartist_alok
    @popartist_alok Před rokem +3

    Quiz(Given two numbers a and b, add them then subtract them to a and b using call by reference.)
    #include
    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
    ",a,b);
    ADDSUB(&a,&b);
    printf("now thw value of a is %d and the value of b is %d",a,b);
    return 0;
    }

  • @bullishtrender
    @bullishtrender Před rokem +2

    Harry bhai you are awesome...
    #include
    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
    " , a);
    printf("And the value of b is %d
    " , b);
    sum(&a , &b);
    printf("Now the value of a is %d
    " , a);
    printf("And The value of b is %d" , b);
    return 0;
    }

  • @satyamshahgod-kar
    @satyamshahgod-kar Před 2 lety +4

    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.

  • @snace_gaming
    @snace_gaming Před rokem +1

    #include
    int sum(int a, int b);
    int main()
    {
    int a,b;
    a=4;
    b=3;

    printf("the sum is %d
    ", a+b);
    printf("the mines is %d
    ", a-b);
    return 0;
    }
    int sum(int a, int b)
    {
    return a+b;
    }

  • @atifmalik8012
    @atifmalik8012 Před 5 měsíci

    Call by reference example in this i changed actual value of x and y by using pointer
    #include
    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
    y before calling %f
    ",x,y);
    float d = func1(&x,&y);
    printf(" x after calling %f
    y after calling %f
    ",x,y);
    }

  • @merajaym2148
    @merajaym2148 Před 3 lety +14

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

  • @54ankitakamthes12
    @54ankitakamthes12 Před rokem +2

    // Quick exercise
    #include
    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
    ", a);
    printf("The value of b is %d", b);
    return 0;
    }

  • @user-gi8lt3tc8n
    @user-gi8lt3tc8n Před 4 lety +5

    Thanks sir.. Belkul asan tareke se ap samjate hai

  • @CoralAbhi
    @CoralAbhi Před 4 lety +2

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

  • @atifmalik8012
    @atifmalik8012 Před 5 měsíci

    Thanks harry bhai mere college ke assignment me tha ye question
    #include
    int interchange(int *x,int*y){
    int z;
    z = *x; //stores num1 value in another variable
    *x = *y; //stores num2 value in num1
    *y = z; // stores num1 value in num2
    }
    int main(){
    int a,b;
    printf("Enter the value of num1 :
    ");
    scanf("%d",&a);
    printf("Enter the value of num2 :
    ");
    scanf("%d",&b);
    printf("num1 = %d
    num2 = %d
    ",a,b);
    interchange(&a,&b);
    printf("After interchanging
    ");
    printf("num1 = %d
    num2 = %d
    ",a,b);
    }

  • @tejalmohod9389
    @tejalmohod9389 Před 2 lety +3

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

    int main()
    {
    int a=4;
    int b=3;
    addsub(&a, &b);
    return 0;
    }

  • @mohitsolanki9544
    @mohitsolanki9544 Před 3 lety +3

    Thankyou sir for providing such a great knowledge ..... solved all problems till lec 31.. all challange accepted ...lets move to another lec and solve all problems.. Thank you sir

  • @subhankarkanrar9494
    @subhankarkanrar9494 Před rokem

    Challenge accepted Harry Bhai.
    //QUICK QUIZ:Given two numbers a and b, add them then subtract them and assign them to a and b using call by
    //reference.
    #include
    void call_by_reference(int*x,int*y)
    {
    *x=*x+*y;
    *y=(*x-*y)-*y;
    }
    int main()
    {
    int a=4,b=3;
    printf("The present value of a and b is %d,%d
    ",a,b);
    call_by_reference(&a,&b);
    printf("After running the function,the updated value of a and b is %d,%d
    ",a,b);
    return 0;
    }

  • @mahinpatel8024
    @mahinpatel8024 Před 3 lety +4

    Your are my favourite teacher,
    and my inspiration too.

  • @ronakmaniya2005
    @ronakmaniya2005 Před 19 dny +1

    #include
    using namespace std;
    void calc(int *x, int *y){
    *x = *x + *y;
    *y = *x - *y - *y;
    }
    int main(){
    // cout

  • @athuislive4917
    @athuislive4917 Před rokem

    #include
    int adder(int *a , int *b){
    // call by refrence means we change the value of the values by taking their adress and modifying them .
    int temp = *a ;
    *a = *a + *b ;
    *b = temp - *b ;
    }
    int main(void) {
    int a =6 ,b = 4;
    printf("The value of a is : %d
    And Value of b is : %d
    " , a ,b);
    adder(&a , &b);
    printf("Changed value of a is : %d
    And Changed Value of b is : %d
    " , a ,b);
    return 0;
    }

  • @AdityaKate_
    @AdityaKate_ Před 3 měsíci +1

    Quiz Solution:
    #include
    int add(int* x, int* y)
    {
    return *x + *y;
    }
    int sub(int* d, int* c)
    {
    return *d - *c;
    }
    int main()
    {
    int a=4, b=3;
    printf("%d and %d are two Numbers.
    ", a, b);
    int s = add(&a, &b);
    printf("Addition of Two Numbers is: %d
    ",s);
    int m = sub(&a, &b);
    printf("Subtraction of Two Numbers is: %d
    ",m);
    return 0;
    }

  • @deepeshrathod2044
    @deepeshrathod2044 Před 4 lety +4

    challange accepted
    #include
    void func(int *a,int *b){
    int temp1 = *a+*b;
    int temp2 = *a-*b;
    printf("The values after execution are : %d, %d
    ",temp1 ,temp2);
    }
    int main(){
    int a,b;
    printf("Enter first no.
    ");
    scanf("%d",&a);
    printf("Enter second no.
    ");
    scanf("%d",&b);
    printf("The values of before execution are : %d, %d
    ", a, b);
    func(&a,&b);
    }

    • @rajpatel-yd3ow
      @rajpatel-yd3ow Před 2 lety

      Good

    • @022jayanath3
      @022jayanath3 Před 2 lety

      its absolutely wrong bro ..if you print the values of a and b it should be 7 and 1,,,whereas u are printing temp1 and temp2....the actual arguments a,b should be changed ,,,

  • @dikshantsharma2096
    @dikshantsharma2096 Před 3 lety +4

    @codewithharry your way of telling and understanding C language is very good and nice.
    thanks for videos.

  • @b-digitalb-updated3364
    @b-digitalb-updated3364 Před rokem +6

    // Quick Quiz:
    // Given two numbers a and b, add them then subtract them and assign them to a and b using call by reference.
    // a = 4
    // b = 3
    // after running the function, the values of a and b should be:
    // a = 7
    // b = 1
    #include
    void add_sub(int *add_a, int *add_b)
    {
    int temp1, temp2;
    temp1 = *add_a + *add_b;
    temp2 = *add_a - *add_b;
    *add_a = temp1;
    *add_b = temp2;
    }
    int main()
    {
    int a = 66, b = 95;
    printf("The value of a is %d and b is %d
    ", a, b);
    add_sub(&a, &b);
    printf("After addition and substraction the value of a is %d and b is %d ", a, b);
    return 0;
    }

  • @deeptailor8612
    @deeptailor8612 Před měsícem

    challage accepted !!!!!!!
    #include
    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
    ", a);
    printf("b = %d
    ", b);
    quiz(&a, &b);
    printf("Now the value of a = %d
    ", a);
    printf("Now the value of b = %d
    ", b);
    return 0;
    }

  • @shrikrishnaumbare
    @shrikrishnaumbare Před 3 lety +3

    I can say surely no one can teach as much best provramming as harry dude he is like bro and what a anolgy he gives amazing yaar aasu aagaye aasu 😒😒and also one thing for c laguage may be this is the best playlist ever

  • @user-ld7lg6ch2y
    @user-ld7lg6ch2y Před 8 měsíci

    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

  • @arpitkushwah3408
    @arpitkushwah3408 Před rokem

    #include
    int main() {
    printf("hello harry,nice explanation");
    return 0;
    }

  • @Gaurav_chandnani
    @Gaurav_chandnani Před 2 lety +2

    You are such a amazing teacher......lot of love and blessings from all cs students

  • @atifmalik8012
    @atifmalik8012 Před 5 měsíci

    Call by value
    #include
    int multiply(float a,float b){
    return a*b;
    }
    int main() {
    float x =5,y=4.5;
    float m = multiply(x,y);
    printf("%f",m);
    }

  • @binodbastola8255
    @binodbastola8255 Před rokem

    // Wap a program ,given two numbers a and b.Add them then subtract them and assign them to a nd b by using call by reference.
    #include
    void operation(int* x,int* y)
    {
    int sum,difference;
    sum= *x+*y;
    difference= *x-*y;
    *x=sum;
    *y=difference;
    }
    int main(int argc, char const *argv[])
    {
    int a=4 ,b=3;
    operation(&a,&b);
    printf("The value of a is %d and the value of b is %d.",a,b);


    return 0;
    }

  • @gamingwithbroly9289
    @gamingwithbroly9289 Před rokem

    challenge accepted and here is my solution to the quick quiz
    #include
    int func(int*a,int*b){
    int temp;
    temp = *a;
    *a = *a+*b;
    *b = temp-*b;
    }
    int main()
    {
    int a =4 , b =3;
    printf("The value of a and b are %d %d
    " ,a,b);
    func(&a,&b);
    printf("The value of a and b are now %d %d
    ",a,b);
    return 0;
    }

  • @sandeeppareek8941
    @sandeeppareek8941 Před 4 lety +15

    // Challenge accepted.
    // Author name; Sandeep Pareek
    //Question:- Given two numbers a and b, add them then subtract them to a and b using call by reference.
    #include
    int assign(int *x, int *y)
    {
    int h, s;
    h = *x;
    s = *y;
    *x = h + s;
    *y = h - s;
    }
    int main()
    {
    int a, b;
    printf("Enter the value of a
    ");
    scanf("%d", &a);
    printf("Enter the value of b
    ");
    scanf("%d", &b);
    assign(&a, &b);
    printf("Value of a is %d and b is %d", a, b);
    return 0;
    }

  • @yashmeenkhan3638
    @yashmeenkhan3638 Před 3 lety +1

    Sir app bhot acha smjhate ho apki vjeh se mujhe 5 % to smjh aa gya

  • @anuragroy4540
    @anuragroy4540 Před rokem

    challenge excepted......
    #include
    void additionsubtraction function(int* x,int*y);
    {
    int temp=*x;
    *x=*x+*y;
    *y=temp-*y;
    return;
    }
    int main()
    {
    int a=4,int b=3;
    printf(" the value of a is %d and the value of b is %d
    ",a,b);
    additionsubtraction function(&a,&b);
    printf(" the value of a now is %d and the value of b now is %d
    ",a,b);
    return 0;
    }

  • @barunjena6171
    @barunjena6171 Před 3 lety +8

    Sir I completed your challenge for printing triangle and reversed triangle now. It was awesome how I was able to find the solution eventually by making mistakes and then learning from my mistakes. It was trial and error again and again and after three hours I made it! I also found it interesting how many times my intuition works faster than my brain reaches the logic behind the intuition. It helps a lot in programming.

    • @gayatriyadav3766
      @gayatriyadav3766 Před 3 lety

      I have written the code and posted it in the previous video, please check and correct me if I am wrong anywhere

    • @barunjena6171
      @barunjena6171 Před 3 lety

      @@gayatriyadav3766 I can't find your code in the previous video, paste it here.

    • @ravineemkarolijoshinainital
      @ravineemkarolijoshinainital Před 2 lety

      It's probably late. Not to brag but my code was done in around 5 mins.
      I would think that some concepts were not clear at the time.

    • @namansharma8515
      @namansharma8515 Před rokem

      @@ravineemkarolijoshinainital well you might have experience in some other kind of logical things but for a beginner to solve without looking anywhere is a good thing because in the try and error we come across different errors and learn something new

    • @ravineemkarolijoshinainital
      @ravineemkarolijoshinainital Před rokem

      @@namansharma8515 looking back at the comment after a year, ironically I was probably bragging about it.
      I was just a dumb kid I guess.

  • @Rohit_Kumar_Gupta
    @Rohit_Kumar_Gupta Před rokem +1

    Challenge💪
    #include
    void as(int *a, int *b) {
    int add = *a + *b;
    int sub = *a - *b;
    *a = add;
    *b = sub;
    }
    int main() {
    int num1, num2;
    printf("Enter two numbers: ");
    scanf("%d %d", &num1, &num2);
    as(&num1, &num2);
    printf("add= %d
    ", num1);
    printf("sub= %d
    ", num2);
    return 0;
    }

  • @wizard.01
    @wizard.01 Před rokem +1

    No doubt,it's the best video on this topic.The examples which you gave made it even more simpler and easier to understand. Thank you!

  • @intekhabalam4482
    @intekhabalam4482 Před 4 lety +8

    // challenge accepted, please see the two successful exercise below.
    /*
    #include
    void interesting(int *add , int *subtract);
    int main()
    {
    int a=99,b=88;
    printf("The sum of %d and %d is %d
    ",a,b,a+b);
    interesting(&a, &b);
    printf("The new value of a and b is %d and %d respectively.",a,b);
    return 0;

    }
    void interesting(int *add, int *subtract)
    {
    int temp= *add;
    *add = *add + *subtract;
    *subtract = temp - *subtract;
    return;
    } */
    //example II
    #include
    void magic(int *x, int *y)
    {
    int temp = *x;
    *x = (*x + *y);
    *y = (temp * *y);

    return;

    }
    main()
    {
    int add, multiply;
    printf("Enter the value you want to see as add and multiply.
    ");
    printf("Enter the first number
    ");
    scanf("%d",&add);
    printf("Enter the second number
    ");
    scanf("%d",&multiply);
    printf("the Entered numbers are %d and %d
    ",add, multiply);
    magic(&add, &multiply);
    printf("Add is %d and Multiply is %d",add,multiply);
    }

    • @ipb4isleep
      @ipb4isleep Před 4 lety +2

      your comment is so much underrated

  • @narayan_prajapati2028
    @narayan_prajapati2028 Před 4 lety +6

    Ek no sirrr. Challenge accepted

  • @vikashtyagi7286
    @vikashtyagi7286 Před rokem +1

    Challenge accepted
    #include
    int challenge (int *x,int *y);
    int main()
    {
    int a=10,b=7;
    printf("The value of a : %d
    ",a);
    printf("The value of b : %d
    ",b);
    challenge (&a,&b);
    printf("
    The value of a : %d
    ",a);
    printf("
    The value of b : %d
    ",b);
    return 0;
    }
    int challenge (int *x,int *y){
    int temp = *x;
    *x = *x+*y;
    *y = temp - (*y);
    return 0;
    }

  • @akshitsangwan_
    @akshitsangwan_ Před 3 lety +4

    Hats off to u Harry bhaiya for your immense efforts!!

  • @AnkitSingh-mh7ee
    @AnkitSingh-mh7ee Před 2 lety +1

    Herry bhai your way of explaining the actual perameter and formal perameter is really superb .

  • @toufikumar7169
    @toufikumar7169 Před rokem +1

    #include
    void sow(int *a ,int *b){
    int temp;
    temp = *a+*b;
    *b=*a-*b;
    *a=temp;
    }
    int main(int argc, char const *argv[])
    {
    int a = 4 ,b= 3;
    printf("%d and %d
    ",a,b);
    sow(&a,&b);
    printf("%d and Secend %d",a,b);
    return 0;
    }
    OutPut:
    4 and 3
    7 and Secend 1.
    ans is :
    a= 7 and b= 1.

  • @Radheradhe-ww8vl
    @Radheradhe-ww8vl Před měsícem

    Radhe Radhe Harry Bhaiya
    here is my quick quiz code:-
    #include
    void afterprogramme(int *A, int *B)
    {
    int x = 4, y = 3;
    *A = x + y;
    *B = x - y;
    return;
    }
    int main()
    {
    int a = 4, b = 3;
    printf("The value of a is %d and The value of b is %d
    ", a, b);
    afterprogramme(&a, &b);
    printf("The value of a after programme is %d and The value of b after programm is %d
    ", a, b);
    return 0;
    }

  • @itsfate6535
    @itsfate6535 Před rokem

    void quiz(int* a, int* b){
    int sum = *a + *b;
    int diff = *a - *b;
    *a = sum;
    *b = diff;
    }

  • @SandipBhattacharya
    @SandipBhattacharya Před rokem +3

    Thank you for uploading this excellent video, Harry. Let me briefly add by saying, there are two most popular ways to call functions for parameter passing.
    *Call by Value:* This method copies the value of an actual parameter or argument into the formal parameter of the function. Both actual and formal parameters are stored in different memory locations (in RAM). So, any changes that are made to the formal parameters in the called function are not reflected in the actual parameters in the calling function. Okay? By default, C programming uses call by value to pass parameters.
    *Call by Reference:* In this approach, the address of an actual parameter is copied into the formal parameter. Both actual and formal parameters refer to the same memory location. So, any changes that are made to the formal parameters in the called function are actually reflected in the actual parameters of the caller function. In C, we can use pointers to get the effect of call by reference or pass by reference, whatever you call it.
    Hope it helps!

  • @rajivmishra1110
    @rajivmishra1110 Před 2 lety

    /* Harry bhaiya's assignment*/
    #include
    int sum(int *c,int *d)
    {
    int s=*c+*d;
    }
    int difference(int*e,int*f)
    {
    int d=*e-*f;
    }
    int main()
    {
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%d and %d",a,b);
    a=sum(&a,&b);
    b=difference(&a,&b);
    printf("%d and %d",a,b);
    return 0;
    }

  • @jazibqureshi4821
    @jazibqureshi4821 Před 2 lety +2

    Harry bhai it is very easy.
    Btw challenge accepted.

  • @TechnicalAnkesh
    @TechnicalAnkesh Před 4 lety +1

    challenge accepted
    solved:
    #include
    int sum(int *a, int *b)
    {
    int sum;
    sum = *a + *b;
    return sum;
    }
    int subtract(int *a, int *b)
    {
    int result;
    result = *a - *b;
    return result;
    }
    int assign(int *a, int *b)
    {
    int result;
    result = *a *= *b;
    }
    int main()
    {
    int a = 4, b = 3;
    printf("The value of a is %d and b is %d
    ", a, b);
    printf("After adding a and b the sum is %d
    ", sum(&a, &b));
    printf("After subtracting them the value is %d
    ", subtract(&a, &b));
    printf("After assigning the value is %d
    ", assign(&a, &b));
    return 0;
    }

  • @utsavjasani1771
    @utsavjasani1771 Před rokem

    subse jyada easy way
    #include
    void changevalue(int *a)
    {
    *a = 4;
    }
    int main()
    {
    int a = 4, b = 3;
    printf("The value of is now %d
    ", a);
    changevalue(&a);
    printf("The value of is now %d
    ", b);
    printf("a+b=%d
    ", a + b);
    printf("a+b=%d
    ", a - b);
    return 0;
    }

  • @rishikumar-uf7tu
    @rishikumar-uf7tu Před 2 měsíci +1

    25:31 very important quiz

  • @balajicv8293
    @balajicv8293 Před 4 lety

    quick quiz answer=
    int change_the_value (int *ptra,int*ptrb){
    int c= *ptra+*ptrb;
    int d=*ptra-*ptrb;
    *ptra=c;
    *ptrb=d;
    return 0;
    }
    #include
    int main()
    {
    int a,b;
    printf("Enter the first number
    ");
    scanf("%d",&a);
    printf("Enter the second number
    ");
    scanf("%d",&b);
    change_the_value(&a,&b);
    printf("%d ,%d
    ",a,b);
    return 0;
    }

  • @adinathrangnekar3064
    @adinathrangnekar3064 Před 2 lety +1

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

  • @awmotovtube2952
    @awmotovtube2952 Před 2 měsíci

    using call by reference
    #include
    void addition(int*a,int*b)
    {
    int temp;
    temp=*a;
    *a=*a+*b;
    }
    void subtraction(int*a,int*b)
    {
    int temp;
    temp=*b;
    *b=*b-*a;
    }
    int main()//programm start for the main function .
    {
    int x=8,y=9; //this is global variable declaration.
    printf("Before running the function, the value of x = %d and value of y = %d
    ", x, y);
    addition(&x,&y);//function call
    subtraction(&x,&y); //function call
    printf("After running the function, the value of x = %d and value of y = %d
    ", x,y);
    return 0;
    }

  • @abhiraj3477
    @abhiraj3477 Před 5 lety +4

    Nice please JavaScript ka course kijiye

  • @AbdKhan2309
    @AbdKhan2309 Před rokem

    I did this code by myself and with your help ofcourse.. Thnakyou Thankyou thankyou
    #include
    int addition(int a, int b)
    {
    return a + b;
    }
    int sub(int x, int y)
    {
    return x - y;
    }
    int main()
    {
    int num;
    int a , b , c;
    int x, y, z;
    while (1)
    {

    printf("ENTER 1 FOR ADDITION AND 2 FOR SUBTRACTION
    ");
    scanf("%d", &num);
    switch (num)
    {
    case 1:
    printf("enter the value of a
    ");
    scanf("%d", &a);
    printf("enter the value of b
    ");
    scanf("%d", &b);
    printf("the value of a is %d and the value of b is %d
    ", a, b);
    c = addition(a, b);
    printf("the sum is %d
    ", c);
    break;
    case 2:
    printf("enter the value of x
    ");
    scanf("%d", &x);
    printf("enter the value of y
    ");
    scanf("%d", &y);
    printf("the value of x and y is %d, %d
    ", x, y);
    z = sub(x, y);
    printf("the subtraction is %d
    ", z);
    break;
    default:
    break;
    }
    }
    return 0;
    }

  • @Sejal622
    @Sejal622 Před měsícem +1

    #include
    int assign(int*a, int*b)
    {
    *a= *a+*b;
    *b= *a-*b-*b;
    printf("The value of a now is %d.
    ", *a);
    printf("The value of b now is %d.
    ", *b);
    }
    int main()
    {
    int a = 56, b =43;
    printf("The value of addition is %d.
    ", a+b);

    printf("The value of subtraction is %d.
    ", a-b);
    assign(&a,&b);
    return 0;
    }

  • @ShrirajKandale
    @ShrirajKandale Před rokem

    Quick quiz ans;
    /* Given two no. a and b, add them and then subtract them and assign them to a and b resp using call by reference. */
    //a =5
    //b =4
    //after running the function the values of a and b should be:
    //a = 9
    //b = 1
    #include
    void func( int *x, int *y)
    {
    int temp = *x;
    *x = *x + *y;
    *y = temp - *y;
    }
    int main()
    {
    int a,b;
    printf("enter a = ");
    scanf("%d",&a);
    printf("enter b = ");
    scanf("%d",&b);
    func(&a, &b);
    printf("after using function the valyes are
    ");
    printf("a = %d
    b =%d",a,b);
    return 0;
    }

  • @smitsoni6078
    @smitsoni6078 Před rokem

    Challenge accepted sir
    CODE :-
    /* Question :- Given two numbers a and b, add them then subtract them to a and b
    using call by reference.
    Date: 25/02/2022 */
    #include
    // Fucntion call by reference Quiz
    void arith(int *x,int *y){
    int temp;
    temp = *x; // to temporary store the value of *x
    *x = *x + *y;
    *y = temp - *y;
    }
    int main()
    {
    int a = 20;
    int b = 12;
    printf("
    Before function calling
    ");
    printf("a = %d
    ",a);
    printf("b = %d
    ",b);
    arith(&a,&b);
    printf("
    After function calling
    ");
    printf("a = %d
    ",a);
    printf("b = %d
    ",b);
    return 0;
    }
    OUTPUT :-
    Before function calling
    a = 20
    b = 12
    After function calling
    a = 32
    b = 8

  • @varunkolanu
    @varunkolanu Před rokem

    Challenge accepted sir:
    #include
    int func(int *x, int *y)
    {
    *x=*x+*y;
    *y=*x-2*(*y);
    }
    int main()
    {
    int a,b;
    scanf("%d %d",&a,&b);
    func(&a,&b);
    printf("a is %d, b is %d", a,b);
    return 0;
    }

  • @harshitgupta355
    @harshitgupta355 Před 4 lety +7

    Nice drawing sir ❤️❤️❤️

  • @anirudhparasaran2890
    @anirudhparasaran2890 Před 2 lety

    26:09
    quiz solution:
    #include
    void func(int *a,int * b)
    {
    int temp;
    temp=*a;
    *a=*a+*b;
    *b=temp-*b;
    }
    int main()
    {
    int a,b;
    printf("enter a and b:");
    scanf("%d %d",&a,&b);
    printf("The values of a and b are %d and %d !
    ",a,b);
    func(&a,&b);
    printf("New a and b are %d and %d !
    ",a,b);
    }

  • @user-hp3fx7kl4u
    @user-hp3fx7kl4u Před rokem

    Quick Quiz Solution:-
    #include
    void swap(int *x,int *y){
    int sum=*x+*y;
    *y=*x-*y;
    *x=sum;
    }
    int main()
    {
    int a=10,b=40;
    printf("Before=> a: %d, b: %d
    ",a,b);
    swap(&a,&b);
    printf("After=> a: %d, b: %d
    ",a,b);
    return 0;
    }

  • @notimepass7754
    @notimepass7754 Před rokem

    wah sir what's explanation, maja aa gaya, i am watching this video before one hour of my c language exam BCA(S.S JAIN SUBODH PG COLLEGE JAIPUR)
    THANK YOU SIR, LOVE YOU 🤍🤍

  • @atifmalik8012
    @atifmalik8012 Před 5 měsíci +1

    Quick quiz solution
    #include
    int assign(int* ptra ,int*ptrb){
    int x,y;
    x = *ptra;
    y = *ptrb;
    *ptra = x + y;
    *ptrb = x - y;
    }
    int main(){
    int a,b;
    printf("Enter a :
    ");
    scanf("%d",&a);
    printf("Enter b :
    ");
    scanf("%d",&b);
    printf("The value of a is %d
    ",a);
    printf("The value of b is %d
    ",b);
    assign(&a,&b);
    printf("The value of addition is %d
    ",a);
    printf("The value of subtraction is %d
    ",b);
    }

  • @sushantravva8533
    @sushantravva8533 Před 2 lety +1

    // given 2 numbers a and b, add them then subtract them
    // and assign them to a and b using call by reference
    // make a = abs(a-b) and b = a+b
    #include
    void modify(int *x, int *y)
    {
    if (*x > *y)
    {
    int m;
    m = *x; // stored a copy of the value of a in a variable m
    *x = *x - *y;
    *y = m + *y;
    }
    else if (*x < *y)
    {
    int n;
    n = *x; // stored a copy of the value of a in a variable n
    *x = *y - *x;
    *y = *y + n;
    }
    }
    int main()
    {
    int a = 16, b = 20;
    printf("The value of a before modification is %d and the value of b before modification is %d
    ", a, b);
    modify(&a, &b);
    printf("The new value of a after modification is %d and the new value of b after modification is %d
    ", a, b);
    return 0;
    }

  • @namansharma8515
    @namansharma8515 Před rokem +1

    #include
    void sumdiff(int *x, int *y)
    { int temp;
    temp= *x;
    *x = *x + *y;
    *y = temp - *y;
    }
    int main()
    {
    int a, b;
    printf("Enter the value of a
    ");
    scanf("%d", &a);
    printf("Enter the value of b
    ");
    scanf("%d", &b);
    sumdiff(&a, &b);
    printf("The sum is %d and differnce is %d
    ", a, b);
    return 0;
    }

  • @LiTtLeGyAnBySubhash
    @LiTtLeGyAnBySubhash Před 4 lety +1

    Apne Talent se banaye hai sir jii, plzz check kr lijiye. :-)
    #include
    void changeValue(int* x, int* y)
    {
    *x = *x + *y;
    *y = *x - *y;
    }
    int main()
    {
    int a=4, b=3;
    changeValue(&a, &b);
    printf("the value of a is now %d
    ", a);
    printf("the value of b is now %d
    ", b);
    return 0;
    }

    • @shaharslan3372
      @shaharslan3372 Před 3 lety

      ye b ka value 4 dikha raha ha ....

    • @pratiksuryawanshi8282
      @pratiksuryawanshi8282 Před 3 lety +2

      @@shaharslan3372 chagevalue function mai x ka value first expression mai update hoga x=7
      Then in next line y=7-3 hoga
      Isce acha hai ki add sub do variable declare karo aur usme addition subtraction perform karna
      Add=*x+*y;
      Sub=*x-*y;
      Ab ans of add and sub 7 and 1
      Assign values to x and y now
      *X=add
      *Y=sub
      To a and b ka value 7 and 1 ayega

  • @chandrashekharchavan519
    @chandrashekharchavan519 Před rokem +1

    # include
    void swap(int*a, int*b){
    int temp = *a+*b;
    int temp2 = *a-*b;
    *a = temp;
    *b = temp2;
    return;
    }
    int main(){
    int x=5, y=3;
    // printf("the addition of x and y is %d
    ",add(x,y));
    printf("the swap of x and y is %d and %d
    ", x,y);
    swap(&x,&y);
    printf("the swap of x and y is %d and %d
    ", x,y);

    return 0;
    }

  • @vipulponugoti7120
    @vipulponugoti7120 Před 11 měsíci

    // Quick Quiz:
    // Given two numbers a and b, add them then subtract them and assign them to a and b using call by reference.
    // a = 4
    // b = 3
    // after running the function, the values of a and b should be:
    // a = 7
    // b = 1
    #include
    void ar(int* x,int*y)
    {
    int temp=*x;
    *x=*x+*y;
    *y=temp-*y;
    }
    int main()
    {
    int a=4,b=3;
    printf("The value of a is %d and b is %d
    ",a,b);
    ar(&a,&b);
    printf("The value a now is %d and b now is %d
    ",a,b);
    return 0;
    }

  • @rajumandal4156
    @rajumandal4156 Před rokem

    /*Quick Quiz;
    Given two numbers a and b, add them then subtract them and assign them to a and b using call by reference.

    a = 4
    b = 3
    after running the function, the values of a and b should be :
    a = 7
    b = 1
    */
    #include
    void add_sub(int *a1 ,int *b1)
    {
    int temp;
    temp=*a1;
    *a1= *a1 + *b1;
    *b1 = temp - *b1;
    }
    int main()
    {
    int a = 4, b =3 ;
    printf("the value of a is %d and the value of b is %d
    ",a,b);
    add_sub(&a,&b);
    printf("the value of a and b now is %d and %d
    ",a,b);

    return 0;
    }

  • @noomanrazakhan6373
    @noomanrazakhan6373 Před 3 lety +2

    Yes bhaiya smjh m aya. N challenge accepted

  • @sakshamsingh3216
    @sakshamsingh3216 Před rokem +1

    Challenge accepted
    #include
    void swp(int *x,int *y)
    {
    int temp;
    temp = *x - *y;
    *x = *x + *y;
    *y =temp;
    }
    int main()
    {
    int a = 5;
    int b = 10;
    printf("
    The value of a is %d and b is %d",a,b);
    swp(&a,&b);
    printf("
    Now value of a is %d and b is %d",a,b);
    return 0;
    }

  • @kavyagandhi8839
    @kavyagandhi8839 Před 2 lety

    #include
    // write a function which will add two numbers and subtract it and assign the value to same variables
    void addsubtract(int *a, int *b)
    {
    int sum = *a + *b;
    int difference = *a -*b;
    *a = sum;
    *b = difference;
    }
    int main()
    {
    int a = 80, b = 200;
    printf("a:%d and b:%d
    ", a, b);
    addsubtract(&a, &b);
    printf("a(added):%d and b(subracted):%d", a, b);
    return 0;
    }

  • @riteshsingh2705
    @riteshsingh2705 Před 4 lety +3

    Bro ek java ka complete course plz

  • @goharrahman09
    @goharrahman09 Před 5 lety +3

    hello sir me na c programming coures ap se shero keya hai lakin installation me kuch samj me nahi aya ab ne jess tara hello word program lika hai me isaye tara na hai lek sakta hu buhat differenc hai apke aur mera programm writting me plzz help me

  • @prashantmehta2832
    @prashantmehta2832 Před 4 lety +3

    #include
    void swap(int *x, int *y)
    {
    int temp;
    temp = *x;
    *x = *y + *x;
    *y = temp - *y;
    return;
    }
    #include
    int main()
    {
    int a=4, b = 3;
    printf("the velue of %d and %d
    ", a,b);
    swap(&a, &b);
    printf("new valuea are %d and %d", a, b);
    return 0;
    }

  • @MizanurRahaman03
    @MizanurRahaman03 Před 4 lety +1

    challenge accepted
    input:-
    #include
    int functionsum(int *x, int *y)
    {
    int sum;
    sum = *x + *y;
    }
    int functionsub(int *x, int *y)
    {
    int sum;
    sum = *x - *y;
    }
    int functionmul(int *x, int *y)
    {
    int sum;
    sum = *x * *y;
    }
    int functiondiv(int *x, int *y)
    {
    int sum;
    sum = *x / *y;
    }
    int main()
    {
    int a;
    printf("0. Exit
    ");
    printf("1. Addition
    ");
    printf("2. Substraction
    ");
    printf("3. Multiplication
    ");
    printf("4. Division
    ");
    printf("Entre your number
    ");
    scanf("%d", &a);
    switch (a)
    {
    int mun1, mun2, c;
    case 0:
    printf("Exit from programe
    ");
    break;
    case 1:
    printf("enter your first number=
    ");
    scanf("%d", &mun1);
    printf("enter your second number=
    ");
    scanf("%d", &mun2);
    c = functionsum(&mun1, &mun2);
    printf("the answer is=%d
    ", c);
    break;
    case 2:
    printf("enter your first number=
    ");
    scanf("%d", &mun1);
    printf("enter your second number=
    ");
    scanf("%d", &mun2);
    c = functionsub(&mun1, &mun2);
    printf("the answer is=%d
    ", c);
    break;
    case 3:
    printf("enter your first number=
    ");
    scanf("%d", &mun1);
    printf("enter your second number=
    ");
    scanf("%d", &mun2);
    c = functionmul(&mun1, &mun2);
    printf("the answer is=%d
    ", c);
    break;
    case 4:
    printf("enter your first number=
    ");
    scanf("%d", &mun1);
    printf("enter your second number=
    ");
    scanf("%d", &mun2);
    c = functiondiv(&mun1, &mun2);
    printf("the answer is=%d
    ", c);
    break;
    default:
    printf("you have entered a wrong number
    ");
    }
    return 0;
    }

  • @mrhuntsman5623
    @mrhuntsman5623 Před 5 měsíci

    #include
    void callbyref(int *a,int*b)
    {
    int one=*a;
    int two=*b;
    *a=one+two;
    *b=one-two;
    }
    int main()
    {
    int a=4,b=3;
    printf("The origional value is:
    %d and %d
    ",a,b);
    callbyref(&a,&b);
    printf("The origional value is:
    %d and %d
    ",a,b);
    return 0;
    }
    Challange acepted and completed

  • @gaudanikaushik1849
    @gaudanikaushik1849 Před 6 měsíci

    quick quiz sloved
    #include
    void changevalue(int *a,int *b)
    {
    int add = *a + *b;
    int subtrac = *a - *b;
    *a = add;
    *b = subtrac;
    }
    int main()
    {
    int a = 4,b = 3;
    printf("the value of a now is %d
    ",a);
    printf("the value of b now is %d
    ",b);
    changevalue(&a,&b);
    printf("add is %d
    ",a);
    printf("subtrac is %d
    ",b);
    return 0;
    }

  • @sarv4265
    @sarv4265 Před 11 měsíci

    // Quick Quiz - changing values of variables using call by reference
    #include
    void sum_sub(int* address_of_a, int* address_of_b)
    {
    int temp_a = *address_of_a, temp_b = *address_of_b;
    *address_of_a = temp_a + temp_b;
    *address_of_b = temp_a - temp_b;
    }
    int main()
    {
    int a = 4, b = 3;
    printf("

    Befor running the function:-
    Value of a = %d
    Value of b = %d", a, b);
    sum_sub(&a, &b);
    printf("

    After running the function:-
    Value of a = %d
    Value of b = %d", a, b);
    return 0;
    }

  • @subhankarsahoo1316
    @subhankarsahoo1316 Před 2 lety +1

    Harry bhai thank you for your efforts

  • @balakp918
    @balakp918 Před 4 lety +1

    is this the correct one?
    Please replay.
    #include
    void add(int* a,int* b);
    int main()
    {
    int a = 4;
    int b = 3;

    printf("values are %d %d %d %d",a,b,a+b,a-b);
    add(&a, &b);
    printf("values are %d %d %d %d",a,b,a+b,a-b);
    return 0;
    }
    void add(int* a,int* b){
    *a = 7;
    *b = 1;
    }

  • @namanjain6502
    @namanjain6502 Před 2 lety +1

    // Online C compiler to run C program online
    #include
    void change(int *x,int *y){
    *x=*x+*y;
    *y=*x-2*(*y);
    }
    int main() {
    int a=4,b=3;
    printf("the value of a=%d and b=%d
    ",a,b);
    change(&a,&b);
    printf("the value of a=%d and b=%d",a,b);
    return 0;
    }

  • @newsanalysis8789
    @newsanalysis8789 Před 11 měsíci

    #include
    int operation(int *n1,int *n2){
    int temp=*n1+*n2;
    *n2=*n1-*n2;
    *n1=temp;
    }
    int main(){
    int a=4;
    int b=3;
    printf("before operation value of a and b is %d,%d
    ",a,b);
    operation(&a,&b);
    printf("after operation value of a and b is %d,%d",a,b);
    return 0;
    }

  • @omgaming9573
    @omgaming9573 Před 2 lety +2

    This course is perfect harry bhai ❣❣

  • @shehryarabbasi7809
    @shehryarabbasi7809 Před rokem

    Challenge accepted!
    #include
    void swap(int *a1, int *b1){
    int temp;
    temp = *a1;
    *a1 = *a1 + *b1;
    *b1 = temp - *b1;
    }
    int main()
    {
    int a=7,b=2;
    printf("addition of the numbers is %d + %d = %d
    ",a,b,a+b);
    printf("subtraction of the number is %d - %d = %d
    ",a,b,a-b);
    swap(&a,&b);
    printf("the value of a after swapping the addition result is %d
    ",a);
    printf("the value of b after swapping the subtraction result is %d
    ",b);
    return 0;
    }

  • @Riya-js7im
    @Riya-js7im Před 2 měsíci +1

    Thank you so much sir😊

  • @deependrakumarrout4172

    Thanks you so much bhai because of you i am far away from my college c programming once again thank you so much or ye raha program :-
    #include
    int sum(int *num1, int *num2)
    {
    return *num1+*num2;
    }
    int sub(int *num1, int *num2)
    {
    return *num1-*num2;
    }
    int main()
    {
    int a,b;
    printf("Enter a number :");
    scanf("%d",&a);
    printf("Enter another number : ");
    scanf("%d",&b);
    printf("The sum(+) of %d and %d is %d
    ",a,b,sum(&a,&b));
    printf("The sub(-) of %d and %d is %d
    ",a,b,sub(&a,&b));
    return 0;
    }

  • @devprakash6608
    @devprakash6608 Před rokem

    QUIZ ANSWER:
    #include
    int arithmetic(int *a, int *b)
    {
    int sum = *a + *b;
    int sub = *a - *b;
    *a = sum;
    *b = sub;
    return *a, *b;
    }
    int main()
    {
    int a, b;
    printf("Enter the values for a and b:
    ");
    scanf("%d %d", &a, &b);
    arithmetic(&a, &b);
    printf("Number1 + Number2 = %d
    Number1 - Number2 = %d
    ", a, b);
    return 0;
    }

  • @tapansonak1431
    @tapansonak1431 Před 3 lety +1

    Thanks a lot bhaiya, your teaching skills are off the charts.

  • @Delhi_boys453
    @Delhi_boys453 Před 5 měsíci

    quick quiz
    #include
    void add_subtract(int*a,int*b){
    if(*a>*b){
    int temp;
    temp=*a;
    *a=*a+*b;
    *b=temp-*b;
    }
    else{
    int temp;
    temp=*a;
    *a=*a+*b;
    *b=*b-temp;
    }
    }
    int main(){
    int a=4,b=3;
    printf("a=%d and b=%d
    ",a,b);
    add_subtract(&a,&b);
    printf("a=%d and b=%d
    ",a,b);
    return 0;
    }