User Profile

Collapse

Profile Sidebar

Collapse
kiara
kiara
Last Activity: Jan 22 '12, 07:58 PM
Joined: Jan 22 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • kiara
    replied to Array: Call by value and Call by reference
    in C
    example for call by reference:
    #include<stdio. h>
    main()
    {
    int add(int*,int*);
    int sum,n1,n2;
    printf("enter the no.s");
    scanf("%d%d",&n 1,&n2);
    sum=add(&n1,&n2 );
    printf("%d",sum );
    }
    int add(int *x,int *y)
    {
    int sum;
    sum=*x+*y;
    return sum;
    }


    the difference: in call by value we r passing...
    See more | Go to post

    Leave a comment:


  • kiara
    replied to Array: Call by value and Call by reference
    in C
    example for call by value:(with return and argument type)
    #include<stdio. h>
    main()
    {
    int add(int,int);
    int n1,n2,sum;
    printf("enter two no's");
    scanf("%d%d",&n 1,&n2);
    sum=add(n1,n2);
    printf("%d",sum );
    }
    int add(int x,int y)
    {
    int sum;
    sum=x+y;
    return sum;
    }
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...