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 program to swap Two numbers without using temp variable.

Answer Posted / ram thilak.p

#include<stdio.h>
#include<conio.h>

void main()
{
int a,b,*p1,*p2;
clrscr();
printf("\n\n\t Enter The Values Of A and B:");
scanf("%d %d",&a,&b);
*p1=a;
*p2=b;
b=*p1;
a=*p2;
printf("\n\n\t The Values Of Elements After Swapping Is:%d %d",a,b);
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why clrscr is used in c?

1014


How can I find the modification date of a file?

1277


Why is sizeof () an operator and not a function?

1026


Why shouldn’t I start variable names with underscores?

1057


Place the #include statement must be written in the program?

1032


writ a program to compare using strcmp VIVA and viva with its output.

2014


On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

1108


List a few unconditional control statement in c.

983


Using which language Test cases are added in .ptu file of RTRT unit testing???

4273


How do you override a defined macro?

1262


What is static memory allocation?

1169


How many levels of pointers have?

1040


write a program to find the given number is prime or not

4747


What is clrscr ()?

1106


Explain why C language is procedural?

1219