6)swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?
Answer Posted / shankar
Value remain same hare....I.E :- X=2,y=3.Because here rules of call by value is applied. If we use call by reference the only value is changed .
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can a program have two main functions?
What is extern storage class in c?
Write programs for String Reversal & Palindrome check
What is putchar() function?
Is c weakly typed?
Explain what are the __date__ and __time__ preprocessor commands?
Can the sizeof operator be used to tell the size of an array passed to a function?
write a c program for swapping two strings using pointer
Is null always equal to 0(zero)?
What are actual arguments?
Explain how does free() know explain how much memory to release?
What is a MAC Address?
Explain data types & how many data types supported by c?
Why functions are used in c?
Explain logical errors? Compare with syntax errors.