Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Are there namespaces in c?

1133


Can I initialize unions?

1045


What is "Hungarian Notation"?

1118


How can I find out the size of a file, prior to reading it in?

1180


How can I avoid the abort, retry, fail messages?

1138


What is null in c?

1096


What is call by value in c?

1008


What is the importance of c in your views?

1176


Which is better pointer or array?

1032


Why enum is used in c?

964


Write a program of prime number using recursion.

1095


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1952


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.

2156


What is the difference between class and object in c?

1180


What is the meaning of typedef struct in c?

1072