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 / shruti
the values will be x =2 and y = 3.
the variables x and y declared in main() are local to main.
whereas
the variables x and y declared in swap() are local to swap..
the change in the value of the variables in either
function will have zero effect on the other function.
Hence the value remains teh same.
| Is This Answer Correct ? | 16 Yes | 1 No |
Post New Answer View All Answers
Differentiate between null and void pointers.
What is meant by realloc()?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
code for replace tabs with equivalent number of blanks
What are the 5 elements of structure?
Tell me what is null pointer in c?
What is the difference between char array and char pointer?
How does sizeof know array size?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Implement bit Array in C.
What is #define?
what do you mean by inline function in C?
How can a program be made to print the name of a source file where an error occurs?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above