write a function which accept two numbers from main() and
interchange them using pointers?
Answer Posted / sarathi
#include<stdio.h>
main()
{
int *p,*q;
*p=10;
*q=20
void swap(int &p,int &q);
}
void swap(int *x,int *y);
{
int *tmp;
*tmp=*x;
*x=*y;
*y=*x;
printf("%d,%d",*x,*y);
}
Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
What does p mean in physics?
how can I convert a string to a number?
Explain 'bit masking'?
Where local variables are stored in c?
How can I get back to the interactive keyboard if stdin is redirected?
What is the use of getchar() function?
Why do we use & in c?
What is the difference between array_name and &array_name?
Explain pointers in c programming?
Tell me what are bitwise shift operators?
Explain zero based addressing.
What is #include stdlib h?
explain what is a newline escape sequence?
What is f'n in math?
Are the expressions * ptr ++ and ++ * ptr same?