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
how to capitalise first letter of each word in a given string?
What is the main difference between calloc () and malloc ()?
Do you have any idea how to compare array with pointer in c?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
how to write a c program to print list of fruits in alpabetical order?
You have given 2 array. You need to find whether they will
create the same BST or not.
For example:
Array1:10 5 20 15 30
Array2:10 20 15 30 5
Result: True
Array1:10 5 20 15 30
Array2:10 15 20 30 5
Result: False
One Approach is Pretty Clear by creating BST O(nlogn) then
checking two tree for identical O(N) overall O(nlogn) ..we
need there exist O(N) Time & O(1) Space also without extra
space .Algorithm ??
DevoCoder
guest
Posted 3 months ago #
#define true 1
#define false 0
int check(int a1[],int a2[],int n1,int n2)
{
int i;
//n1 size of array a1[] and n2 size of a2[]
if(n1!=n2) return false;
//n1 and n2 must be same
for(i=0;i
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
Explain argument and its types.
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What is queue in c?
Explain the difference between getch() and getche() in c?
What is #include called?
What is d scanf?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.