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

What is void pointers in c?

958


What is the significance of an algorithm to C programming?

997


Are the expressions * ptr ++ and ++ * ptr same?

1088


How to set file pointer to beginning c?

1145


What is #include conio h?

945


What is a program flowchart?

1125


How does normalization of huge pointer works?

1100


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3183


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

1207


What are the usage of pointer in c?

1122


In which header file is the null macro defined?

1302


Explain what is the difference between the expression '++a' and 'a++'?

1153


Why we use void main in c?

1099


How can I handle floating-point exceptions gracefully?

1108


What does %p mean?

1032