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
Are there namespaces in c?
Can I initialize unions?
What is "Hungarian Notation"?
How can I find out the size of a file, prior to reading it in?
How can I avoid the abort, retry, fail messages?
What is null in c?
What is call by value in c?
What is the importance of c in your views?
Which is better pointer or array?
Why enum is used in c?
Write a program of prime number using recursion.
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
What is the difference between class and object in c?
What is the meaning of typedef struct in c?