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 is identifier in c?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
Why calloc is better than malloc?
Difference between exit() and _exit() function?
what is the structure pointer?
What are the similarities between c and c++?
Does free set pointer to null?
What is difference between constant pointer and constant variable?
What does main () mean in c?
Explain a file operation in C with an example.
define string ?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
Write the control statements in C language
What does the characters “r” and “w” mean when writing programs that will make use of files?