what is the difference between call by value and call by
reference?

Answers were Sorted based on User's Feedback



what is the difference between call by value and call by reference?..

Answer / m.karthiga

in call by value the changes do not affect the value of a
variable because value is passed.but call by reference
should affect the value of a variable because address is
passed

Is This Answer Correct ?    16 Yes 5 No

what is the difference between call by value and call by reference?..

Answer / vijay r15

call by value means passing the value of variable.
Ex fun(a,b)

Call by ref means passing the address of the variable.
Ex fun(&a,&b)

By
Vijay r15
raj.vijay55@gmail.com

Is This Answer Correct ?    8 Yes 2 No

what is the difference between call by value and call by reference?..

Answer / rama krishna sidhartha

Call by value means passing the values.

Call by reference means passing the address of the variables
given.

Is This Answer Correct ?    7 Yes 2 No

what is the difference between call by value and call by reference?..

Answer / mahesh

call by value
int fun(int a,int b);
int fun(int p,int q)
{
temp=p;
p=q;
q=temp;
}
call by reference
int fun(int &a,int &b);
int fun(int *a,int *b)
{
temp=*a;
*a=*b;
*b=temp;
}
call by value is with values n call by ref with adresses n
pointers...

Is This Answer Correct ?    5 Yes 1 No

what is the difference between call by value and call by reference?..

Answer / raju

Call by Value: C support the call by value, where the caller
pass the value to the function and the updates on the
function will not effect on the caller.

Call by reverence: Here will pass the reference of the
variable to function, the update on the function variables
will effect on the caller.

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More C Interview Questions

what is the Output? int a=4 b=3; printf("%d%d%d%d%d%d",a++,++a,a++,a++,++a,a++); printf("%d%d%d%d%d%d",b--,b--,--b,b--,--b,--b);

10 Answers   IBM,


Tell me when would you use a pointer to a function?

0 Answers  


What is new line escape sequence?

0 Answers  


What is difference between class and structure?

0 Answers  


Why calloc is better than malloc?

0 Answers  






output for following code??? main() { int x=2,y,z; x*=3+2; printf("1.%d\n",x); x*=y=z=4; printf("2.%d %d %d\n",x,y,z); x=y==z; printf("3.%d\n",x); x==(y=z); printf("%d",x); }

2 Answers   Elysium,


What is variable in c example?

0 Answers  


write a c program to remove all the duplicate characters in a string and replace with single character? ex:-input- AAABBBCCC output- ABC

2 Answers   HCL,


number 2 plssssss help !!....using array.. turbo c.. create a program that will accept a number and determine if it is a happy number or an unhappy number.. example: enter a number : 7 7*7=49 then 4 and 9 4*4 and 9*9== 16 + 18 gives you 97 then 9 and 7 9*9 and 7*7 == 81 + 49 gives you 130 then 1 and 3 1*1 and 3*3 == 1 + 9 gives you 10 1*1 gives you 1 sample output: 7= 49= 16+81= 97= 81+49=130 =1+9=10 =1 "7 is a happy number" . if the last number is 2 then the number being inputed is not a happy number.

3 Answers  


int main() { int x = (2,3,4); int y = 9,10,11; printf("%d %d",x,y); } what would be the output?

7 Answers   Parimal, Wipro,


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a<b,printb.find the sum digits of that number & then print.if a==b multiply 10 with a & add 20 with b store in c and then print

0 Answers  


program that accepts amount in figures and print that in words

2 Answers   Infosys, Lovely Professional University, Wipro,


Categories